mirror of
https://github.com/DeLaGuardo/setup-clojure.git
synced 2025-01-14 18:37:56 +08:00
Pass PATH and JAVA_CMD when exec'ing the setup scripts
This commit is contained in:
parent
38cb63c34a
commit
4a2f78e98e
19
dist/index.js
vendored
19
dist/index.js
vendored
@ -1561,6 +1561,12 @@ function installBoot(binScript, destinationFolder, version) {
|
|||||||
BOOT_VERSION: 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'}`, [], {
|
yield exec.exec(`./boot ${version === 'latest' ? '-u' : '-V'}`, [], {
|
||||||
cwd: path.join(destinationFolder, 'boot', 'bin'),
|
cwd: path.join(destinationFolder, 'boot', 'bin'),
|
||||||
env
|
env
|
||||||
@ -3372,11 +3378,18 @@ function installLeiningen(binScript, destinationFolder) {
|
|||||||
const version_cmd = IS_WINDOWS
|
const version_cmd = IS_WINDOWS
|
||||||
? 'powershell .\\lein.ps1 self-install'
|
? 'powershell .\\lein.ps1 self-install'
|
||||||
: './lein version';
|
: './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, [], {
|
yield exec.exec(version_cmd, [], {
|
||||||
cwd: path.join(destinationFolder, 'leiningen', 'bin'),
|
cwd: path.join(destinationFolder, 'leiningen', 'bin'),
|
||||||
env: {
|
env: env
|
||||||
LEIN_HOME: path.join(destinationFolder, 'leiningen')
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
return path.join(destinationFolder, 'leiningen');
|
return path.join(destinationFolder, 'leiningen');
|
||||||
}
|
}
|
||||||
|
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
@ -74,7 +74,7 @@ async function installBoot(
|
|||||||
await io.mv(bin, path.join(binDir, `boot`))
|
await io.mv(bin, path.join(binDir, `boot`))
|
||||||
fs.chmodSync(path.join(binDir, `boot`), '0755')
|
fs.chmodSync(path.join(binDir, `boot`), '0755')
|
||||||
|
|
||||||
let env = {}
|
let env: {[key: string]: string} = {};
|
||||||
if (version === 'latest') {
|
if (version === 'latest') {
|
||||||
env = {
|
env = {
|
||||||
BOOT_HOME: path.join(destinationFolder, 'boot')
|
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'}`, [], {
|
await exec.exec(`./boot ${version === 'latest' ? '-u' : '-V'}`, [], {
|
||||||
cwd: path.join(destinationFolder, 'boot', 'bin'),
|
cwd: path.join(destinationFolder, 'boot', 'bin'),
|
||||||
env
|
env
|
||||||
|
@ -65,11 +65,20 @@ async function installLeiningen(
|
|||||||
? 'powershell .\\lein.ps1 self-install'
|
? 'powershell .\\lein.ps1 self-install'
|
||||||
: './lein version'
|
: './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, [], {
|
await exec.exec(version_cmd, [], {
|
||||||
cwd: path.join(destinationFolder, 'leiningen', 'bin'),
|
cwd: path.join(destinationFolder, 'leiningen', 'bin'),
|
||||||
env: {
|
env: env
|
||||||
LEIN_HOME: path.join(destinationFolder, 'leiningen')
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return path.join(destinationFolder, 'leiningen')
|
return path.join(destinationFolder, 'leiningen')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user