File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import * as tar from 'tar';
5
5
import axios from 'axios' ;
6
6
import * as unzipper from 'unzipper' ;
7
7
import { Semaphore } from 'async-mutex' ;
8
+ import * as os from "os" ;
8
9
9
10
export class CxInstaller {
10
11
private readonly platform : string ;
@@ -63,7 +64,7 @@ export class CxInstaller {
63
64
}
64
65
65
66
const url = await this . getDownloadURL ( ) ;
66
- const zipPath = this . getZipPath ( ) ;
67
+ const zipPath = path . join ( os . tmpdir ( ) , `ast-cli. ${ this . platform === 'win32' ? 'zip' : 'tar.gz' } ` ) ;
67
68
68
69
await this . downloadFile ( url , zipPath ) ;
69
70
console . log ( 'Downloaded CLI to:' , zipPath ) ;
@@ -106,12 +107,6 @@ export class CxInstaller {
106
107
} ) ;
107
108
}
108
109
109
- getZipPath ( ) : string {
110
- return this . platform === 'win32'
111
- ? path . join ( this . resourceDirPath , 'cx.zip' )
112
- : path . join ( this . resourceDirPath , 'cx.tar.gz' ) ;
113
- }
114
-
115
110
checkExecutableExists ( ) : boolean {
116
111
return fs1 . existsSync ( this . getExecutablePath ( ) ) ;
117
112
}
You can’t perform that action at this time.
0 commit comments