Skip to content

Commit 627a5e8

Browse files
committed
download zip to tmp dir
1 parent 3166236 commit 627a5e8

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/main/osinstaller/CxInstaller.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import * as tar from 'tar';
55
import axios from 'axios';
66
import * as unzipper from 'unzipper';
77
import { Semaphore } from 'async-mutex';
8+
import * as os from "os";
89

910
export class CxInstaller {
1011
private readonly platform: string;
@@ -63,7 +64,7 @@ export class CxInstaller {
6364
}
6465

6566
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'}`);
6768

6869
await this.downloadFile(url, zipPath);
6970
console.log('Downloaded CLI to:', zipPath);
@@ -106,12 +107,6 @@ export class CxInstaller {
106107
});
107108
}
108109

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-
115110
checkExecutableExists(): boolean {
116111
return fs1.existsSync(this.getExecutablePath());
117112
}

0 commit comments

Comments
 (0)