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 0381c30320 Update index.js
2023-12-11 16:23:35 +01:00

25 lines
858 B
JavaScript

const fs = require('fs');
const core = require('@actions/core');
const workspacePath = process.env.GITHUB_WORKSPACE;
const options = core.getInput('options');
const path = core.getInput('path');
if (process.platform === 'win32') {
try {
if (fs.existsSync(workspacePath) && fs.readdirSync(workspacePath).length > 0) {
const { stdout, stderr } = require('child_process').execSync(`"%PROGRAMFILES(X86)%\\Inno Setup 6\\iscc.exe" ${options} "${workspacePath}\\${path}"`, { stdio: 'pipe' });
console.log(stdout);
if (stderr) {
throw new Error(stderr);
}
} else {
throw new Error('The repository was not cloned. Please specify the actions/checkout action before this step.');
}
} catch (error) {
core.setFailed(error.message);
}
} else {
core.setFailed('This action is only supported on Windows!');
}