File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -113,14 +113,22 @@ export class CxInstaller {
113
113
return this . cliVersion ;
114
114
}
115
115
try {
116
- const versionFilePath = path . join ( 'checkmarx-ast-cli.version' ) ;
116
+ const versionFilePath = this . getVersionFilePath ( ) ;
117
117
const versionContent = await readFileAsync ( versionFilePath ) ;
118
118
return versionContent . toString ( ) . trim ( ) ;
119
119
} catch ( error ) {
120
120
logger . warn ( 'Error reading AST CLI version: ' + error . message ) ;
121
121
return this . cliDefaultVersion ;
122
122
}
123
123
}
124
+
125
+ private getVersionFilePath ( ) : string {
126
+ const dirname = __dirname ;
127
+ if ( dirname === '/' ) { // This is the root directory
128
+ return 'checkmarx-ast-cli.version' ;
129
+ }
130
+ return path . join ( dirname , 'checkmarx-ast-cli.version' ) ;
131
+ }
124
132
125
133
private getCompressFolderName ( ) : string {
126
134
return `ast-cli.${ this . platform === 'win32' ? 'zip' : 'tar.gz' } ` ;
You can’t perform that action at this time.
0 commit comments