1
0
mirror of https://github.com/Minionguyjpro/Inno-Setup-Action synced 2026-02-18 17:41:18 +01:00

Update index.js

This commit is contained in:
Minionguyjpro
2023-07-11 11:05:42 +02:00
committed by GitHub
parent f82eb0b576
commit 623cdbbefb

22
dist/index.js vendored
View File

@@ -2,19 +2,25 @@ const core = require('@actions/core');
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
const github = require('@actions/github'); const github = require('@actions/github');
const workspacePath = process.env.GITHUB_WORKSPACE;
const options = core.getInput('options'); const options = core.getInput('options');
const path = core.getInput('path'); const path = core.getInput('path');
var exec = require('child_process').exec; var exec = require('child_process').exec;
if (process.platform === 'win32') { if (process.platform === 'win32') {
exec(`"%PROGRAMFILES(X86)%\\Inno Setup 6\\iscc.exe" ${options} "${path}"`, if (!workspacePath) {
function (error, stdout, stderr) { const code = 1;
console.log(stdout); console.error('Error: the repository was not cloned! Please specify the actions/checkout Github Action before this step.')
console.log(stderr); process.exit(code);
}
exec(`"%PROGRAMFILES(X86)%\\Inno Setup 6\\iscc.exe" ${options} "${path}"`,
function (error, stdout, stderr) {
console.log(stdout);
console.log(stderr);
} }
)} else { )} else {
const code = 1; const code = 1;
console.error('Error: this action is only supported on Windows!') console.error('Error: this action is only supported on Windows!')
process.exit(code); process.exit(code);
} }