mirror of https://github.com/databricks/cli.git
sync options redefine better
This commit is contained in:
parent
1244b3a414
commit
2303f20f95
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue