@@ -26,6 +26,13 @@ import { WorkspaceConfig, GlobalConfig, SetupState } from "./types";
26
26
import { saveSetupState , setSetupState , setWorkspaceState } from "./state-management" ;
27
27
import { pathdivider } from "./tools-validation" ;
28
28
29
+ // Test-only override for narrow update
30
+ let forceNarrowUpdateForTest = false ;
31
+
32
+ export function setForceNarrowUpdateForTest ( value : boolean ) {
33
+ forceNarrowUpdateForTest = value ;
34
+ }
35
+
29
36
let python = os . platform ( ) === "linux" ? "python3" : "python" ;
30
37
31
38
export function checkWestInit ( setupState : SetupState ) {
@@ -118,9 +125,12 @@ export async function westUpdate(context: vscode.ExtensionContext, wsConfig: Wor
118
125
wsConfig . activeSetupState . zephyrVersion = undefined ;
119
126
saveSetupState ( context , wsConfig , globalConfig ) ;
120
127
121
- // Read config option from settings.json
128
+ // Read config option from settings.json, but allow test override
122
129
const configuration = vscode . workspace . getConfiguration ( 'zephyr-ide' ) ;
123
- const useNarrowUpdate = configuration . get < boolean > ( 'westNarrowUpdate' , false ) ; // default false
130
+ let useNarrowUpdate = configuration . get < boolean > ( 'westNarrowUpdate' , false ) ;
131
+ if ( forceNarrowUpdateForTest ) {
132
+ useNarrowUpdate = true ;
133
+ }
124
134
let cmd = useNarrowUpdate ? 'west update --narrow' : 'west update' ;
125
135
let westUpdateRes = await executeTaskHelperInPythonEnv ( wsConfig . activeSetupState , "Zephyr IDE: West Update" , cmd , wsConfig . activeSetupState . setupPath ) ;
126
136
0 commit comments