From 15e498d0834d0ffa0bfad24701c742f2c682fb1d Mon Sep 17 00:00:00 2001 From: Minionguyjpro Date: Tue, 11 Jul 2023 16:34:33 +0200 Subject: [PATCH] Update index.js --- dist/index.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index f04ff5e..0478bc3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,6 @@ +const fs = require('fs'); const core = require('@actions/core'); +// eslint-disable-next-line no-unused-vars const github = require('@actions/github'); const workspacePath = process.env.GITHUB_WORKSPACE; @@ -8,16 +10,15 @@ 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 action before this step.'); - process.exit(code); - } else { - console.log(process.env.GITHUB_WORKSPACE); + if (fs.existsSync(process.env.GITHUB_WORKSPACE)) { exec(`"%PROGRAMFILES(X86)%\\Inno Setup 6\\iscc.exe" ${options} "${workspacePath}\\${path}"`, function (error, stdout, stderr) { console.log(stdout); console.log(stderr); }); + } else { + const code = 1; + console.error('Error: The repository was not cloned. Please specify the actions/checkout action before this step.'); + process.exit(code); } } else { const code = 1;