@@ -129,8 +129,6 @@ export async function workspaceSetupFromWestGit(context: vscode.ExtensionContext
129
129
return false ;
130
130
}
131
131
132
- // Setup west environment before initialization
133
- await setupWestEnvironment ( context , wsConfig , globalConfig , false ) ;
134
132
135
133
// Initialize west with the provided git URL
136
134
let westSelection : WestLocation = {
@@ -140,14 +138,8 @@ export async function workspaceSetupFromWestGit(context: vscode.ExtensionContext
140
138
additionalArgs : ""
141
139
} ;
142
140
143
- let westInitResult = await westInit ( context , wsConfig , globalConfig , false , westSelection ) ;
144
-
145
- if ( ! westInitResult ) {
146
- vscode . window . showErrorMessage ( "Failed to initialize west with git repository." ) ;
147
- return false ;
148
- }
149
141
// Run post-setup process
150
- postWorkspaceSetup ( context , wsConfig , globalConfig , currentDir ) ;
142
+ postWorkspaceSetup ( context , wsConfig , globalConfig , currentDir , westSelection ) ;
151
143
return true ;
152
144
}
153
145
@@ -181,23 +173,8 @@ export async function workspaceSetupStandard(context: vscode.ExtensionContext, w
181
173
return false ;
182
174
}
183
175
184
- // If west selector created a manifest, we need to run west init
185
- if ( westSelection . path || westSelection . gitRepo ) {
186
- output . appendLine ( "[SETUP] Initializing west with selected configuration..." ) ;
187
-
188
- // Setup west environment before initialization
189
- await setupWestEnvironment ( context , wsConfig , globalConfig , false ) ;
190
-
191
- let westInitResult = await westInit ( context , wsConfig , globalConfig , false , westSelection ) ;
192
-
193
- if ( ! westInitResult ) {
194
- vscode . window . showErrorMessage ( "Failed to initialize west workspace." ) ;
195
- return false ;
196
- }
197
- }
198
-
199
176
// Run post-setup process (same as current directory)
200
- postWorkspaceSetup ( context , wsConfig , globalConfig , currentDir ) ;
177
+ postWorkspaceSetup ( context , wsConfig , globalConfig , currentDir , westSelection ) ;
201
178
return true ;
202
179
}
203
180
@@ -330,30 +307,22 @@ export async function workspaceSetupFromCurrentDirectory(context: vscode.Extensi
330
307
331
308
}
332
309
333
- if ( using_current_directory_for_install ) {
334
- // Check if .venv folder exists - if not, setup west environment
335
- const venvPath = path . join ( currentDir , ".venv" ) ;
336
- if ( ! fs . pathExistsSync ( venvPath ) ) {
337
- output . appendLine ( "[SETUP] No .venv folder found, setting up west environment..." ) ;
338
- await setupWestEnvironment ( context , wsConfig , globalConfig , false ) ;
339
- output . appendLine ( "[SETUP] Continuing..." ) ;
340
- }
310
+ let westSelection : WestLocation | undefined = undefined ;
341
311
312
+ if ( using_current_directory_for_install ) {
342
313
// Set up the workspace using current directory
343
314
await setSetupState ( context , wsConfig , globalConfig , currentDir ) ;
344
315
if ( westYmlPath ) {
345
- let westSelection : WestLocation = {
316
+ westSelection = {
346
317
path : westYmlPath ,
347
318
failed : false ,
348
319
gitRepo : "" ,
349
320
additionalArgs : ""
350
321
} ;
351
-
352
- westInit ( context , wsConfig , globalConfig , false , westSelection ) ;
353
322
}
354
323
}
355
324
// Run post-setup process
356
- postWorkspaceSetup ( context , wsConfig , globalConfig , currentDir ) ;
325
+ postWorkspaceSetup ( context , wsConfig , globalConfig , currentDir , westSelection ) ;
357
326
return true ;
358
327
}
359
328
@@ -421,24 +390,10 @@ export async function workspaceSetupGlobalZephyr(context: vscode.ExtensionContex
421
390
return false ;
422
391
}
423
392
424
- // If west selector created a manifest, we need to run west init
425
- if ( westSelection . path || westSelection . gitRepo ) {
426
- output . appendLine ( "[SETUP] Initializing west with selected configuration..." ) ;
427
-
428
- // Setup west environment before initialization
429
- await setupWestEnvironment ( context , wsConfig , globalConfig , false ) ;
430
-
431
- let westInitResult = await westInit ( context , wsConfig , globalConfig , false , westSelection ) ;
432
-
433
- if ( ! westInitResult ) {
434
- vscode . window . showErrorMessage ( "Failed to initialize west workspace." ) ;
435
- return false ;
436
- }
437
- }
438
393
439
394
// Run post-setup process
440
395
441
- postWorkspaceSetup ( context , wsConfig , globalConfig , globalToolsDir ) . then (
396
+ postWorkspaceSetup ( context , wsConfig , globalConfig , globalToolsDir , westSelection ) . then (
442
397
result => {
443
398
if ( result ) {
444
399
vscode . window . showInformationMessage ( `Global Zephyr installation created and workspace configured at: ${ globalToolsDir } ` ) ;
@@ -530,23 +485,9 @@ export async function workspaceSetupCreateNewShared(context: vscode.ExtensionCon
530
485
return false ;
531
486
}
532
487
533
- // If west selector created a manifest, we need to run west init
534
- if ( westSelection . path || westSelection . gitRepo ) {
535
- output . appendLine ( "[SETUP] Initializing west with selected configuration..." ) ;
536
-
537
- // Setup west environment before initialization
538
- await setupWestEnvironment ( context , wsConfig , globalConfig , false ) ;
539
-
540
- let westInitResult = await westInit ( context , wsConfig , globalConfig , false , westSelection ) ;
541
-
542
- if ( ! westInitResult ) {
543
- vscode . window . showErrorMessage ( "Failed to initialize west workspace." ) ;
544
- return false ;
545
- }
546
- }
547
488
548
489
// Run post-setup process
549
- postWorkspaceSetup ( context , wsConfig , globalConfig , selectedPath ) . then (
490
+ postWorkspaceSetup ( context , wsConfig , globalConfig , selectedPath , westSelection ) . then (
550
491
result => {
551
492
if ( result ) {
552
493
vscode . window . showInformationMessage ( `New shared Zephyr installation created at: ${ selectedPath } ` ) ;
@@ -570,14 +511,14 @@ async function selectExistingInstallation(wsConfig: WorkspaceConfig, globalConfi
570
511
const setupState = globalConfig . setupStateDictionary [ installPath ] ;
571
512
let description = "" ;
572
513
573
- // Add helpful descriptions
574
- const versionStr = setupState . zephyrVersion ? String ( setupState . zephyrVersion ) : "installation" ;
514
+ // Add helpful descriptionsconst
515
+ let versionStr = setupState . zephyrVersion ? setupState . zephyrVersion . major + "." + setupState . zephyrVersion . minor + "." + setupState . zephyrVersion . patch : "installation" ;
575
516
if ( installPath === getToolsDir ( ) ) {
576
- description = `Global ${ versionStr } ` ;
517
+ description = `Global Zephyr ${ versionStr } ` ;
577
518
} else if ( installPath === wsConfig . rootPath ) {
578
- description = `Current ${ versionStr } ` ;
519
+ description = `Current Zephyr ${ versionStr } ` ;
579
520
} else if ( setupState . zephyrVersion ) {
580
- description = versionStr ;
521
+ description = `Zephyr ` + versionStr ;
581
522
} else {
582
523
description = "West installation" ;
583
524
}
0 commit comments