@@ -78,31 +78,31 @@ export function urlToOptions(url: string): https.RequestOptions {
78
78
return options ;
79
79
}
80
80
81
- export function downloadDirToExecutablePath ( dir : string ) {
82
- if ( process . platform === 'win32' ) {
81
+ export function downloadDirToExecutablePath ( dir : string , platform : DownloadPlatform ) {
82
+ if ( platform === 'win32-archive' || platform === 'win32-x64-archive ') {
83
83
return path . resolve ( dir , 'Code.exe' ) ;
84
- } else if ( process . platform === 'darwin' ) {
84
+ } else if ( platform === 'darwin' ) {
85
85
return path . resolve ( dir , 'Visual Studio Code.app/Contents/MacOS/Electron' ) ;
86
86
} else {
87
87
return path . resolve ( dir , 'VSCode-linux-x64/code' ) ;
88
88
}
89
89
}
90
90
91
- export function insidersDownloadDirToExecutablePath ( dir : string ) {
92
- if ( process . platform === 'win32' ) {
91
+ export function insidersDownloadDirToExecutablePath ( dir : string , platform : DownloadPlatform ) {
92
+ if ( platform === 'win32-archive' || platform === 'win32-x64-archive ') {
93
93
return path . resolve ( dir , 'Code - Insiders.exe' ) ;
94
- } else if ( process . platform === 'darwin' ) {
94
+ } else if ( platform === 'darwin' ) {
95
95
return path . resolve ( dir , 'Visual Studio Code - Insiders.app/Contents/MacOS/Electron' ) ;
96
96
} else {
97
97
return path . resolve ( dir , 'VSCode-linux-x64/code-insiders' ) ;
98
98
}
99
99
}
100
100
101
- export function insidersDownloadDirMetadata ( dir : string ) {
101
+ export function insidersDownloadDirMetadata ( dir : string , platform : DownloadPlatform ) {
102
102
let productJsonPath ;
103
- if ( process . platform === 'win32' ) {
103
+ if ( platform === 'win32-archive' || platform === 'win32-x64-archive ') {
104
104
productJsonPath = path . resolve ( dir , 'resources/app/product.json' ) ;
105
- } else if ( process . platform === 'darwin' ) {
105
+ } else if ( platform === 'darwin' ) {
106
106
productJsonPath = path . resolve ( dir , 'Visual Studio Code - Insiders.app/Contents/Resources/app/product.json' ) ;
107
107
} else {
108
108
productJsonPath = path . resolve ( dir , 'VSCode-linux-x64/resources/app/product.json' ) ;
@@ -136,14 +136,14 @@ export async function getLatestInsidersMetadata(platform: string) {
136
136
* Resolve the VS Code cli path from executable path returned from `downloadAndUnzipVSCode`.
137
137
* Usually you will want {@link resolveCliArgsFromVSCodeExecutablePath} instead.
138
138
*/
139
- export function resolveCliPathFromVSCodeExecutablePath ( vscodeExecutablePath : string ) {
140
- if ( process . platform === 'win32' ) {
139
+ export function resolveCliPathFromVSCodeExecutablePath ( vscodeExecutablePath : string , platform : DownloadPlatform ) {
140
+ if ( platform === 'win32' ) {
141
141
if ( vscodeExecutablePath . endsWith ( 'Code - Insiders.exe' ) ) {
142
142
return path . resolve ( vscodeExecutablePath , '../bin/code-insiders.cmd' ) ;
143
143
} else {
144
144
return path . resolve ( vscodeExecutablePath , '../bin/code.cmd' ) ;
145
145
}
146
- } else if ( process . platform === 'darwin' ) {
146
+ } else if ( platform === 'darwin' ) {
147
147
return path . resolve ( vscodeExecutablePath , '../../../Contents/Resources/app/bin/code' ) ;
148
148
} else {
149
149
if ( vscodeExecutablePath . endsWith ( 'code-insiders' ) ) {
@@ -171,8 +171,8 @@ export function resolveCliPathFromVSCodeExecutablePath(vscodeExecutablePath: str
171
171
*
172
172
* @param vscodeExecutablePath The `vscodeExecutablePath` from `downloadAndUnzipVSCode`.
173
173
*/
174
- export function resolveCliArgsFromVSCodeExecutablePath ( vscodeExecutablePath : string , options ?: Pick < TestOptions , 'reuseMachineInstall' > ) {
175
- const args = [ resolveCliPathFromVSCodeExecutablePath ( vscodeExecutablePath ) ] ;
174
+ export function resolveCliArgsFromVSCodeExecutablePath ( vscodeExecutablePath : string , options ?: Pick < TestOptions , 'reuseMachineInstall' | 'platform' > ) {
175
+ const args = [ resolveCliPathFromVSCodeExecutablePath ( vscodeExecutablePath , options ?. platform ?? process . platform ) ] ;
176
176
if ( ! options ?. reuseMachineInstall ) {
177
177
args . push ( ...getProfileArguments ( args ) ) ;
178
178
}
0 commit comments