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() wsc := prj.WorkspacesClient()
if *remotePath == "" { if *remotePath == "" {
me, err := prj.Me() prjRemotePath, err := prj.RemoteRoot()
if err != nil { if err != nil {
return err return err
} }
repositoryName, err := git.RepositoryName() *remotePath = prjRemotePath
if err != nil { } else {
return err prj.OverrideRemoteRoot(*remotePath)
}
*remotePath = fmt.Sprintf("/Repos/%s/%s", me.UserName, repositoryName)
} }
log.Printf("[INFO] Remote file sync location: %v", *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) return fmt.Errorf("repo not found, please ensure %s exists", *remotePath)
} }
root := prj.Root() root := prj.LocalRoot()
syncCallback := getRemoteSyncCallback(ctx, root, *remotePath, wsc) syncCallback := getRemoteSyncCallback(ctx, root, *remotePath, wsc)
err = spawnSyncRoutine(ctx, *interval, syncCallback, *remotePath) err = spawnSyncRoutine(ctx, *interval, syncCallback, *remotePath)
return err return err