From 0b1b05bab7466bbecfefcc269bc170c9e3ace381 Mon Sep 17 00:00:00 2001 From: Minionguyjpro Date: Tue, 11 Jul 2023 11:21:04 +0200 Subject: [PATCH] Update index.js --- dist/index.js | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/dist/index.js b/dist/index.js index 79f8c61..a008ed1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,5 +1,4 @@ const core = require('@actions/core'); -// eslint-disable-next-line no-unused-vars const github = require('@actions/github'); const workspacePath = process.env.GITHUB_WORKSPACE; @@ -9,18 +8,18 @@ const path = core.getInput('path'); var exec = require('child_process').exec; if (process.platform === 'win32') { - if (workspacePath === "") { - const code = 1; - console.error('Error: the repository was not cloned! Please specify the actions/checkout Github Action before this step.') - process.exit(code); - } - exec(`"%PROGRAMFILES(X86)%\\Inno Setup 6\\iscc.exe" ${options} "${path}"`, - function (error, stdout, stderr) { - console.log(stdout); - console.log(stderr); - } - )} else { + if (!workspacePath) { const code = 1; - console.error('Error: this action is only supported on Windows!') - process.exit(code); + console.error('Error: The repository was not cloned. Please specify the actions/checkout action before this step.'); + process.exit(code); + } + + exec(`"%PROGRAMFILES(X86)%\\Inno Setup 6\\iscc.exe" ${options} "${path}"`, function (error, stdout, stderr) { + console.log(stdout); + console.log(stderr); + }); +} else { + const code = 1; + console.error('Error: This action is only supported on Windows!'); + process.exit(code); }