mirror of
https://github.com/Minionguyjpro/Inno-Setup-Action
synced 2026-02-18 09:31:19 +01:00
Update things again...
This commit is contained in:
6
src/index.js
Normal file
6
src/index.js
Normal file
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* The entrypoint for the action.
|
||||
*/
|
||||
const { run } = require('./main')
|
||||
|
||||
run()
|
||||
26
src/main.js
26
src/main.js
@@ -1,18 +1,16 @@
|
||||
// Importing necessary modules
|
||||
const fs = require('fs');
|
||||
const core = require('@actions/core');
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const github = require('@actions/github');
|
||||
const core = require('@actions/core')
|
||||
const fs = require('fs')
|
||||
|
||||
// Getting the path to the workspace from environment variables
|
||||
const workspacePath = process.env.GITHUB_WORKSPACE;
|
||||
const workspacePath = process.env.GITHUB_WORKSPACE
|
||||
|
||||
// Getting inputs from the workflow
|
||||
const options = core.getInput('options');
|
||||
const path = core.getInput('path');
|
||||
const options = core.getInput('options')
|
||||
const path = core.getInput('path')
|
||||
|
||||
// Importing the child_process module for executing shell commands
|
||||
var exec = require('child_process').exec;
|
||||
var exec = require('child_process').exec
|
||||
|
||||
// Initializing an error variable
|
||||
let error;
|
||||
@@ -24,23 +22,23 @@ if (process.platform === 'win32') {
|
||||
// Building and executing the Inno Setup compiler command
|
||||
exec(`"%PROGRAMFILES(X86)%\\Inno Setup 6\\iscc.exe" ${options} "${workspacePath}\\${path}"`, { stdio: 'ignore' }, function (error, stdout, stderr) {
|
||||
// Logging the standard output of the command
|
||||
console.log(stdout);
|
||||
console.log(stdout)
|
||||
|
||||
// Handling errors, if any
|
||||
if (error) {
|
||||
core.setFailed(stderr);
|
||||
process.exit(error.code || 1);
|
||||
core.setFailed(stderr)
|
||||
process.exit(error.code || 1)
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Setting an error code and failing the workflow if the repository is not cloned
|
||||
error = { code: 1 }
|
||||
core.setFailed('The repository was not cloned. Please specify the actions/checkout action before this step.');
|
||||
process.exit(error.code);
|
||||
process.exit(error.code)
|
||||
}
|
||||
} else {
|
||||
// Setting an error code and failing the workflow if the platform is not Windows
|
||||
error = { code: 1 };
|
||||
core.setFailed('This action is only supported on Windows!');
|
||||
process.exit(error.code);
|
||||
core.setFailed('This action is only supported on Windows!')
|
||||
process.exit(error.code)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user