Skip to content

Commit 6c4b05e

Browse files
committed
check
1 parent ade6356 commit 6c4b05e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/main/osinstaller/CxInstaller.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export class CxInstaller {
114114

115115
const url = await this.getDownloadURL();
116116
if (!url) {
117-
console.log('No valid download URL available for this platform.');
117+
console.error('No valid download URL available for this platform.');
118118
return;
119119
}
120120

@@ -132,7 +132,7 @@ export class CxInstaller {
132132
// Check if the executable exists
133133
async checkExecutableExists(): Promise<boolean> {
134134
let executablePath;
135-
const dirExecutablePath = path.join(__dirname, `../wrapper/resources/`);
135+
const dirExecutablePath = path.join(__dirname, `../../wrapper/resources/`);
136136
if (this.platform === 'win32') {
137137
executablePath = path.join(dirExecutablePath, 'cx.exe');
138138
} else {
@@ -143,7 +143,7 @@ export class CxInstaller {
143143
console.log(`Executable exists at: ${executablePath}`);
144144
return true;
145145
} catch (error) {
146-
console.log(`Executable does not exist at: ${executablePath}`);
146+
console.error(`Executable does not exist at: ${executablePath}`);
147147
return false;
148148
}
149149
}
@@ -190,9 +190,9 @@ async function downloadFile(downloadURLPath: string, filePath: string): Promise<
190190
url: downloadURLPath,
191191
responseType: 'stream'
192192
});
193-
194193
// Create the file stream at the specified filePath
195-
const fileStream = createWriteStream("/Users/benalvo/CxDev/workspace/Pheonix-workspace/ast-cli-javascript-wrapper-runtime-cli/src/main/wrapper/resources/cx");
194+
let check =process.cwd()+"/src/main/wrapper/resources/cx"
195+
const fileStream = createWriteStream(check);
196196

197197
// Pipe the response data to the file
198198
response.data.pipe(fileStream);
@@ -204,7 +204,6 @@ async function downloadFile(downloadURLPath: string, filePath: string): Promise<
204204
});
205205

206206
console.log(`File downloaded successfully to ${filePath}`);
207-
fileStream.close();
208207

209208
} catch (error) {
210209
console.error(`Error during file download: ${error.message}`);

0 commit comments

Comments
 (0)