mirror of
https://github.com/julia-actions/setup-julia.git
synced 2026-02-12 11:06:53 +08:00
Don't print version twice if show-versioninfo is enabled
This commit is contained in:
9
lib/setup-julia.js
generated
9
lib/setup-julia.js
generated
@@ -78,13 +78,16 @@ function run() {
|
|||||||
core.addPath(path.join(juliaPath, 'bin'));
|
core.addPath(path.join(juliaPath, 'bin'));
|
||||||
// Set output
|
// Set output
|
||||||
core.setOutput('julia-bindir', path.join(juliaPath, 'bin'));
|
core.setOutput('julia-bindir', path.join(juliaPath, 'bin'));
|
||||||
// Test if Julia has been installed
|
// Test if Julia has been installed and print the version
|
||||||
exec.exec('julia', ['--version']);
|
|
||||||
// If enabled, also show the full version info
|
|
||||||
if (core.getInput('show-versioninfo') == 'true') {
|
if (core.getInput('show-versioninfo') == 'true') {
|
||||||
|
// If enabled, show the full version info
|
||||||
// --compile=min -O0 reduces the time from ~1.8-1.9s to ~0.8-0.9s
|
// --compile=min -O0 reduces the time from ~1.8-1.9s to ~0.8-0.9s
|
||||||
exec.exec('julia', ['--compile=min', '-O0', '-e', 'using InteractiveUtils; versioninfo()']);
|
exec.exec('julia', ['--compile=min', '-O0', '-e', 'using InteractiveUtils; versioninfo()']);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
// Otherwise only print julia --version to save time
|
||||||
|
exec.exec('julia', ['--version']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
|
|||||||
@@ -74,13 +74,14 @@ async function run() {
|
|||||||
// Set output
|
// Set output
|
||||||
core.setOutput('julia-bindir', path.join(juliaPath, 'bin'))
|
core.setOutput('julia-bindir', path.join(juliaPath, 'bin'))
|
||||||
|
|
||||||
// Test if Julia has been installed
|
// Test if Julia has been installed and print the version
|
||||||
exec.exec('julia', ['--version'])
|
|
||||||
|
|
||||||
// If enabled, also show the full version info
|
|
||||||
if (core.getInput('show-versioninfo') == 'true') {
|
if (core.getInput('show-versioninfo') == 'true') {
|
||||||
|
// If enabled, show the full version info
|
||||||
// --compile=min -O0 reduces the time from ~1.8-1.9s to ~0.8-0.9s
|
// --compile=min -O0 reduces the time from ~1.8-1.9s to ~0.8-0.9s
|
||||||
exec.exec('julia', ['--compile=min', '-O0', '-e', 'using InteractiveUtils; versioninfo()'])
|
exec.exec('julia', ['--compile=min', '-O0', '-e', 'using InteractiveUtils; versioninfo()'])
|
||||||
|
} else {
|
||||||
|
// Otherwise only print julia --version to save time
|
||||||
|
exec.exec('julia', ['--version'])
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message)
|
core.setFailed(error.message)
|
||||||
|
|||||||
Reference in New Issue
Block a user