1
0
mirror of https://github.com/Minionguyjpro/Inno-Setup-Action synced 2026-02-18 17:41:18 +01:00
Files
inno-setup/dist/index.js
Minionguyjpro b8e8eb5936 Update index.js
2023-12-11 17:05:11 +01:00

33 lines
1.0 KiB
JavaScript

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;
const options = core.getInput('options');
const path = core.getInput('path');
var exec = require('child_process').exec;
let error;
if (process.platform === 'win32') {
if (fs.existsSync(process.env.GITHUB_WORKSPACE) && fs.readdirSync(workspacePath).length > 0) {
exec(`"%PROGRAMFILES(X86)%\\Inno Setup 6\\iscc.exe" ${options} "${workspacePath}\\${path}"`, { stdio: 'ignore' }, function (error, stdout, stderr) {
console.log(stdout);
if (error) {
core.setFailed(stderr);
process.exit(error.code || 1);
}
});
} else {
error = { code: 1 }
core.setFailed('The repository was not cloned. Please specify the actions/checkout action before this step.');
process.exit(error.code);
}
} else {
error = { code: 1 };
core.setFailed('This action is only supported on Windows!');
process.exit(error.code);
}