mirror of
https://github.com/DeLaGuardo/setup-clojure.git
synced 2024-12-27 08:31:04 +08:00
Merge pull request #29 from palloberg/master
Make it work on self-hosted runners without Java installed
This commit is contained in:
commit
28c1e37e17
6
.github/workflows/smoke-tests.yml
vendored
6
.github/workflows/smoke-tests.yml
vendored
@ -83,7 +83,8 @@ jobs:
|
||||
java-version: 1.8
|
||||
|
||||
- name: Install leiningen
|
||||
uses: DeLaGuardo/setup-clojure@master
|
||||
# uses: DeLaGuardo/setup-clojure@master
|
||||
uses: ./
|
||||
with:
|
||||
lein: 2.9.1
|
||||
|
||||
@ -108,7 +109,8 @@ jobs:
|
||||
java-version: 1.8
|
||||
|
||||
- name: Install boot
|
||||
uses: DeLaGuardo/setup-clojure@master
|
||||
# uses: DeLaGuardo/setup-clojure@master
|
||||
uses: ./
|
||||
with:
|
||||
boot: 2.8.3
|
||||
|
||||
|
19
dist/index.js
vendored
19
dist/index.js
vendored
@ -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
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`))
|
||||
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
|
||||
|
@ -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')
|
||||
|
Loading…
x
Reference in New Issue
Block a user