mirror of
https://github.com/bvanroll/rpiRadio.git
synced 2025-08-30 04:22:50 +00:00
33 lines
624 B
JavaScript
33 lines
624 B
JavaScript
var exec = require('child_process').exec;
|
|
|
|
var commandline={
|
|
get:getString,
|
|
run:runCommand
|
|
};
|
|
|
|
function runCommand(command){
|
|
//return refrence to the child process
|
|
return exec(
|
|
command
|
|
);
|
|
}
|
|
|
|
function getString(command,callback){
|
|
//return refrence to the child process
|
|
return exec(
|
|
command,
|
|
(
|
|
function(){
|
|
return function(err,data,stderr){
|
|
if(!callback)
|
|
return;
|
|
|
|
callback(err, data, stderr);
|
|
}
|
|
}
|
|
)(callback)
|
|
);
|
|
}
|
|
|
|
module.exports=commandline;
|