Pass PATH and JAVA_CMD when exec'ing the setup scripts

This commit is contained in:
Paul Loberg 2021-05-31 16:40:00 +02:00
parent 38cb63c34a
commit 4a2f78e98e
4 changed files with 37 additions and 8 deletions

19
dist/index.js vendored
View File

@ -1561,6 +1561,12 @@ function installBoot(binScript, destinationFolder, version) {
BOOT_VERSION: version
};
}
if (process.env['PATH']) {
env['PATH'] = process.env['PATH'];
}
if (process.env['JAVA_CMD']) {
env['JAVA_CMD'] = process.env['JAVA_CMD'];
}
yield exec.exec(`./boot ${version === 'latest' ? '-u' : '-V'}`, [], {
cwd: path.join(destinationFolder, 'boot', 'bin'),
env
@ -3372,11 +3378,18 @@ function installLeiningen(binScript, destinationFolder) {
const version_cmd = IS_WINDOWS
? 'powershell .\\lein.ps1 self-install'
: './lein version';
let env = {
LEIN_HOME: path.join(destinationFolder, 'leiningen'),
};
if (process.env['PATH']) {
env['PATH'] = process.env['PATH'];
}
if (process.env['JAVA_CMD']) {
env['JAVA_CMD'] = process.env['JAVA_CMD'];
}
yield exec.exec(version_cmd, [], {
cwd: path.join(destinationFolder, 'leiningen', 'bin'),
env: {
LEIN_HOME: path.join(destinationFolder, 'leiningen')
}
env: env
});
return path.join(destinationFolder, 'leiningen');
}

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -74,7 +74,7 @@ async function installBoot(
await io.mv(bin, path.join(binDir, `boot`))
fs.chmodSync(path.join(binDir, `boot`), '0755')
let env = {}
let env: {[key: string]: string} = {};
if (version === 'latest') {
env = {
BOOT_HOME: path.join(destinationFolder, 'boot')
@ -86,6 +86,13 @@ async function installBoot(
}
}
if (process.env['PATH']) {
env['PATH'] = process.env['PATH']
}
if (process.env['JAVA_CMD']) {
env['JAVA_CMD'] = process.env['JAVA_CMD']
}
await exec.exec(`./boot ${version === 'latest' ? '-u' : '-V'}`, [], {
cwd: path.join(destinationFolder, 'boot', 'bin'),
env

View File

@ -65,11 +65,20 @@ async function installLeiningen(
? 'powershell .\\lein.ps1 self-install'
: './lein version'
let env: {[key: string]: string} = {
LEIN_HOME: path.join(destinationFolder, 'leiningen'),
}
if (process.env['PATH']) {
env['PATH'] = process.env['PATH']
}
if (process.env['JAVA_CMD']) {
env['JAVA_CMD'] = process.env['JAVA_CMD']
}
await exec.exec(version_cmd, [], {
cwd: path.join(destinationFolder, 'leiningen', 'bin'),
env: {
LEIN_HOME: path.join(destinationFolder, 'leiningen')
}
env: env
})
return path.join(destinationFolder, 'leiningen')