@@ -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