From 66addd1b2f97f6f9e0fd2122e6a5c3b8d302a524 Mon Sep 17 00:00:00 2001 From: Sascha Mann Date: Fri, 1 Jan 2021 12:30:30 +0100 Subject: [PATCH] Don't print version twice if show-versioninfo is enabled --- lib/setup-julia.js | 9 ++++++--- src/setup-julia.ts | 9 +++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/setup-julia.js b/lib/setup-julia.js index c93f9f7..42ebdd3 100644 --- a/lib/setup-julia.js +++ b/lib/setup-julia.js @@ -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); diff --git a/src/setup-julia.ts b/src/setup-julia.ts index bf62727..08bab8d 100644 --- a/src/setup-julia.ts +++ b/src/setup-julia.ts @@ -73,14 +73,15 @@ async function run() { // 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)