mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 15:31:42 +00:00
Update shell.js
This commit is contained in:
parent
1a3c8e1b06
commit
e277141bf4
28
lib/shell.js
28
lib/shell.js
|
@ -75,28 +75,28 @@ var ShellObject = function() {
|
|||
|
||||
this.exec = function(cmd, stdOutPath, stdErrPath) {
|
||||
var stdout, stderr;
|
||||
var stdOutPath = (typeof(stdOutPath) === "undefined" ? "stdout.txt" : stdOutPath);
|
||||
var stdErrPath = (typeof(stdErrPath) === "undefined" ? "stderr.txt" : stdErrPath);
|
||||
var stdOutPath = (typeof(stdOutPath) === "undefined" ? "stdout.txt" : stdOutPath);
|
||||
var stdErrPath = (typeof(stdErrPath) === "undefined" ? "stderr.txt" : stdErrPath);
|
||||
|
||||
var c = "%comspec% /c (" + this.build(cmd) + ") 1> " + stdOutPath;
|
||||
//c += " 2>&1";
|
||||
c += " 2> " + stdErrPath;
|
||||
c += " 2> " + stdErrPath;
|
||||
this.interface.Run(c, 0, true);
|
||||
console.info("ShellObject.exec() -> " + c);
|
||||
sleep(1);
|
||||
sleep(1);
|
||||
|
||||
if (FILE.fileExists(stdOutPath)) {
|
||||
stdout = FILE.readFile(stdOutPath, "utf-8");
|
||||
FILE.deleteFile(stdOutPath);
|
||||
}
|
||||
if (FILE.fileExists(stdOutPath)) {
|
||||
stdout = FILE.readFile(stdOutPath, "utf-8");
|
||||
FILE.deleteFile(stdOutPath);
|
||||
}
|
||||
|
||||
if (FILE.fileExists(stdErrPath)) {
|
||||
stderr = FILE.readFile(stdErrPath, "utf-8");
|
||||
FILE.deleteFile(stdErrPath);
|
||||
}
|
||||
if (FILE.fileExists(stdErrPath)) {
|
||||
stderr = FILE.readFile(stdErrPath, "utf-8");
|
||||
FILE.deleteFile(stdErrPath);
|
||||
}
|
||||
|
||||
//console.log("[stdout] " + stdout);
|
||||
//console.log("[stderr] " + stderr);
|
||||
//console.log("[stdout] " + stdout);
|
||||
//console.log("[stderr] " + stderr);
|
||||
|
||||
return stdout;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user