@@ -114,7 +114,7 @@ export class CxInstaller {
114
114
115
115
const url = await this . getDownloadURL ( ) ;
116
116
if ( ! url ) {
117
- console . log ( 'No valid download URL available for this platform.' ) ;
117
+ console . error ( 'No valid download URL available for this platform.' ) ;
118
118
return ;
119
119
}
120
120
@@ -132,7 +132,7 @@ export class CxInstaller {
132
132
// Check if the executable exists
133
133
async checkExecutableExists ( ) : Promise < boolean > {
134
134
let executablePath ;
135
- const dirExecutablePath = path . join ( __dirname , `../wrapper/resources/` ) ;
135
+ const dirExecutablePath = path . join ( __dirname , `../../ wrapper/resources/` ) ;
136
136
if ( this . platform === 'win32' ) {
137
137
executablePath = path . join ( dirExecutablePath , 'cx.exe' ) ;
138
138
} else {
@@ -143,7 +143,7 @@ export class CxInstaller {
143
143
console . log ( `Executable exists at: ${ executablePath } ` ) ;
144
144
return true ;
145
145
} catch ( error ) {
146
- console . log ( `Executable does not exist at: ${ executablePath } ` ) ;
146
+ console . error ( `Executable does not exist at: ${ executablePath } ` ) ;
147
147
return false ;
148
148
}
149
149
}
@@ -190,9 +190,9 @@ async function downloadFile(downloadURLPath: string, filePath: string): Promise<
190
190
url : downloadURLPath ,
191
191
responseType : 'stream'
192
192
} ) ;
193
-
194
193
// 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 ) ;
196
196
197
197
// Pipe the response data to the file
198
198
response . data . pipe ( fileStream ) ;
@@ -204,7 +204,6 @@ async function downloadFile(downloadURLPath: string, filePath: string): Promise<
204
204
} ) ;
205
205
206
206
console . log ( `File downloaded successfully to ${ filePath } ` ) ;
207
- fileStream . close ( ) ;
208
207
209
208
} catch ( error ) {
210
209
console . error ( `Error during file download: ${ error . message } ` ) ;
0 commit comments