File tree 1 file changed +15
-23
lines changed
1 file changed +15
-23
lines changed Original file line number Diff line number Diff line change @@ -263,45 +263,37 @@ export const downloadCoderVersion = async (
263
263
return binaryPath ;
264
264
}
265
265
266
- // Runs our public install script using our options to
267
- // install the binary!
266
+ // Run our official install script to install the binary
268
267
await new Promise < void > ( ( resolve , reject ) => {
269
268
const cp = spawn (
270
- " sh",
269
+ path . join ( __dirname , "../../install. sh") ,
271
270
[
272
- "-c" ,
273
- [
274
- "curl" ,
275
- "-L" ,
276
- "https://coder.com/install.sh" ,
277
- "|" ,
278
- "sh" ,
279
- "-s" ,
280
- "--" ,
281
- "--version" ,
282
- version ,
283
- "--method" ,
284
- "standalone" ,
285
- "--prefix" ,
286
- tempDir ,
287
- "--binary-name" ,
288
- binaryName ,
289
- ] . join ( " " ) ,
271
+ "--version" ,
272
+ version ,
273
+ "--method" ,
274
+ "standalone" ,
275
+ "--prefix" ,
276
+ tempDir ,
277
+ "--binary-name" ,
278
+ binaryName ,
290
279
] ,
291
280
{
292
281
env : {
293
282
...process . env ,
294
283
XDG_CACHE_HOME : "/tmp/coder-e2e-cache" ,
284
+ TRACE : "1" , // tells install.sh to `set -x`, helpful if something goes wrong
295
285
} ,
296
286
} ,
297
287
) ;
298
288
// eslint-disable-next-line no-console -- Needed for debugging
299
- cp . stderr . on ( "data" , ( data ) => console . log ( data . toString ( ) ) ) ;
289
+ cp . stderr . on ( "data" , ( data ) => console . error ( data . toString ( ) ) ) ;
290
+ // eslint-disable-next-line no-console -- Needed for debugging
291
+ cp . stdout . on ( "data" , ( data ) => console . log ( data . toString ( ) ) ) ;
300
292
cp . on ( "close" , ( code ) => {
301
293
if ( code === 0 ) {
302
294
resolve ( ) ;
303
295
} else {
304
- reject ( new Error ( "curl failed with code " + code ) ) ;
296
+ reject ( new Error ( "install.sh failed with code " + code ) ) ;
305
297
}
306
298
} ) ;
307
299
} ) ;
You can’t perform that action at this time.
0 commit comments