Don't print version twice if show-versioninfo is enabled

This commit is contained in:
Sascha Mann
2021-01-01 12:30:30 +01:00
parent 3ff0592a25
commit 66addd1b2f
2 changed files with 11 additions and 7 deletions

9
lib/setup-julia.js generated
View File

@@ -78,13 +78,16 @@ function run() {
core.addPath(path.join(juliaPath, 'bin'));
// Set output
core.setOutput('julia-bindir', path.join(juliaPath, 'bin'));
// Test if Julia has been installed
exec.exec('julia', ['--version']);
// If enabled, also show the full version info
// Test if Julia has been installed and print the version
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
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) {
core.setFailed(error.message);