This commit is contained in:
Shreyas Goenka 2022-11-23 13:44:10 +01:00
parent 66d32f914f
commit e66710b200
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
1 changed files with 5 additions and 7 deletions

View File

@ -23,15 +23,13 @@ var syncCmd = &cobra.Command{
wsc := prj.WorkspacesClient()
if *remotePath == "" {
me, err := prj.Me()
prjRemotePath, err := prj.RemoteRoot()
if err != nil {
return err
}
repositoryName, err := git.RepositoryName()
if err != nil {
return err
}
*remotePath = fmt.Sprintf("/Repos/%s/%s", me.UserName, repositoryName)
*remotePath = prjRemotePath
} else {
prj.OverrideRemoteRoot(*remotePath)
}
log.Printf("[INFO] Remote file sync location: %v", *remotePath)
@ -43,7 +41,7 @@ var syncCmd = &cobra.Command{
return fmt.Errorf("repo not found, please ensure %s exists", *remotePath)
}
root := prj.Root()
root := prj.LocalRoot()
syncCallback := getRemoteSyncCallback(ctx, root, *remotePath, wsc)
err = spawnSyncRoutine(ctx, *interval, syncCallback, *remotePath)
return err