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:
27
dist/index.js
vendored
27
dist/index.js
vendored
@@ -1,28 +1,23 @@
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const core = require('@actions/core');
|
const core = require('@actions/core');
|
||||||
// eslint-disable-next-line no-unused-vars
|
|
||||||
const github = require('@actions/github');
|
|
||||||
|
|
||||||
const workspacePath = process.env.GITHUB_WORKSPACE;
|
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;
|
|
||||||
|
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
if (fs.existsSync(process.env.GITHUB_WORKSPACE) && fs.readdirSync(workspacePath).length > 0) {
|
try {
|
||||||
exec(`"%PROGRAMFILES(X86)%\\Inno Setup 6\\iscc.exe" ${options} "${workspacePath}\\${path}"`, { stdio: 'ignore' }, function (error, stdout, stderr) {
|
if (fs.existsSync(workspacePath) && fs.readdirSync(workspacePath).length > 0) {
|
||||||
console.log(stdout);
|
const { stderr } = require('child_process').execSync(`"%PROGRAMFILES(X86)%\\Inno Setup 6\\iscc.exe" ${options} "${workspacePath}\\${path}"`, { stdio: 'inherit' });
|
||||||
if (error) {
|
if (stderr) {
|
||||||
core.error(stderr);
|
throw new Error(stderr);
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
});
|
} else {
|
||||||
} else {
|
throw new Error('The repository was not cloned. Please specify the actions/checkout action before this step.');
|
||||||
core.error('Error: The repository was not cloned. Please specify the actions/checkout action before this step.');
|
}
|
||||||
exit(1);
|
} catch (error) {
|
||||||
|
core.setFailed(error.message);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
core.error('Error: This action is only supported on Windows!');
|
core.setFailed('This action is only supported on Windows!');
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user