@@ -30,6 +30,10 @@ export class SyncTask extends Task {
3030 constructor (
3131 connection : ConnectionManager ,
3232 cli : CliWrapper ,
33+ // TODO: https://github.com/databricks/databricks-vscode/issues/111
34+ // use syncType to decide the sync type for bricks cli. Right now bricks cli
35+ // only supports full sync for multiple profiles.
36+ // see: https://github.com/databricks/bricks/issues/71
3337 syncType : "full" | "incremental"
3438 ) {
3539 super (
@@ -88,8 +92,24 @@ class LazySyncProcessExecution extends ProcessExecution {
8892 throw new Error ( "!!!!!" ) ;
8993 }
9094
95+ const profile = this . connection . profile ;
96+ if ( ! profile ) {
97+ window . showErrorMessage (
98+ "Can't start sync: Databricks connection not configured!"
99+ ) ;
100+ throw new Error (
101+ "Can't start sync: Databricks connection not configured!"
102+ ) ;
103+ }
104+
91105 return {
92106 cwd : workspacePath ,
107+ env : {
108+ /* eslint-disable @typescript-eslint/naming-convention */
109+ BRICKS_ROOT : workspacePath ,
110+ DATABRICKS_CONFIG_PROFILE : profile ,
111+ /* eslint-enable @typescript-eslint/naming-convention */
112+ } ,
93113 } ;
94114 } ,
95115 } ,
@@ -100,19 +120,8 @@ class LazySyncProcessExecution extends ProcessExecution {
100120 if ( this . command ) {
101121 return this . command ;
102122 }
103-
104- const me = this . connection . me ;
105123 const syncDestination = this . connection . syncDestination ;
106- const profile = this . connection . profile ;
107124
108- if ( ! me || ! profile ) {
109- window . showErrorMessage (
110- "Can't start sync: Databricks connection not configured!"
111- ) ;
112- throw new Error (
113- "Can't start sync: Databricks connection not configured!"
114- ) ;
115- }
116125 if ( ! syncDestination ) {
117126 window . showErrorMessage (
118127 "Can't start sync: Databricks synchronization destination not configured!"
@@ -122,12 +131,7 @@ class LazySyncProcessExecution extends ProcessExecution {
122131 ) ;
123132 }
124133
125- this . command = this . cli . getSyncCommand (
126- profile ,
127- me ,
128- syncDestination ,
129- this . syncType
130- ) ;
134+ this . command = this . cli . getSyncCommand ( syncDestination ) ;
131135
132136 return this . command ;
133137 }
0 commit comments