mirror of
https://github.com/Minionguyjpro/Inno-Setup-Action
synced 2026-02-19 01:41:19 +01:00
Revert "Remove node_modules"
This commit is contained in:
42
node_modules/node-cmd/cmd.js
generated
vendored
Normal file
42
node_modules/node-cmd/cmd.js
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
const { exec, execSync } = require('child_process');
|
||||
|
||||
const commandline={
|
||||
run:runCommand,
|
||||
runSync:runSync,
|
||||
};
|
||||
|
||||
function runCommand(command,callback){
|
||||
|
||||
return exec(
|
||||
command,
|
||||
(
|
||||
function(){
|
||||
return function(err,data,stderr){
|
||||
if(!callback)
|
||||
return;
|
||||
|
||||
callback(err, data, stderr);
|
||||
}
|
||||
}
|
||||
)(callback)
|
||||
);
|
||||
}
|
||||
|
||||
function runSync(command){
|
||||
try {
|
||||
return {
|
||||
data: execSync(command).toString(),
|
||||
err: null,
|
||||
stderr: null
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
return {
|
||||
data: null,
|
||||
err: error.stderr.toString(),
|
||||
stderr: error.stderr.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports=commandline;
|
||||
Reference in New Issue
Block a user