fix exporting env vars on linux

This commit is contained in:
Robert Brignull
2020-08-26 16:40:58 +01:00
parent e9bfa56061
commit 688df282cd
3 changed files with 5 additions and 3 deletions

View File

@@ -138,7 +138,8 @@ program
// Assume that anything that's not windows is using a unix-style shell
const envFile = path.join(config.tempDir, 'codeql-env.sh');
const envFileContents = Object.entries(tracerConfig.env)
.map(([key, value]) => `${key}="${value}"`)
// Some vars contain ${LIB} that we do not want to be expanded when executing this script
.map(([key, value]) => `export ${key}="${value.replace('$', '\\$')}"`)
.join('\n');
fs.writeFileSync(envFile, envFileContents);