sync options redefine better

This commit is contained in:
Shreyas Goenka 2023-06-02 00:04:18 +02:00
parent 1244b3a414
commit 2303f20f95
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
3 changed files with 13 additions and 5 deletions

View File

@ -21,6 +21,9 @@ func getSync(ctx context.Context, b *bundle.Bundle) (*sync.Sync, error) {
SnapshotBasePath: cacheDir,
WorkspaceClient: b.WorkspaceClient(),
PersistSnapshot: true,
AllowOverwrites: true,
}
return sync.New(ctx, opts)
}

View File

@ -25,6 +25,9 @@ func syncOptionsFromBundle(cmd *cobra.Command, b *bundle.Bundle) (*sync.SyncOpti
SnapshotBasePath: cacheDir,
WorkspaceClient: b.WorkspaceClient(),
PersistSnapshot: true,
AllowOverwrites: true,
}
return &opts, nil
}

View File

@ -31,11 +31,13 @@ var importDirCmd = &cobra.Command{
// Initialize syncer to do a full sync with the correct from source to target.
// This will upload the local files
opts := sync.SyncOptions{
LocalPath: sourcePath,
RemotePath: targetPath,
Full: true,
WorkspaceClient: databricks.Must(databricks.NewWorkspaceClient()),
DisallowOverwrites: !importDirOverwrite,
LocalPath: sourcePath,
RemotePath: targetPath,
Full: true,
WorkspaceClient: databricks.Must(databricks.NewWorkspaceClient()),
AllowOverwrites: importDirOverwrite,
PersistSnapshot: false,
}
s, err := sync.New(ctx, opts)
if err != nil {