mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-15 06:01:04 +00:00
Update shell.js
This commit is contained in:
parent
7b0f0e3455
commit
6f5bfdfe74
10
lib/shell.js
10
lib/shell.js
|
@ -2,6 +2,9 @@
|
||||||
// Shell API
|
// Shell API
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
var FILE = require("lib/file");
|
var FILE = require("lib/file");
|
||||||
|
var RAND = require("lib/rand");
|
||||||
|
|
||||||
|
var SEED = RAND.getSeed();
|
||||||
|
|
||||||
var ShellObject = function() {
|
var ShellObject = function() {
|
||||||
this.interface = null;
|
this.interface = null;
|
||||||
|
@ -68,9 +71,8 @@ var ShellObject = function() {
|
||||||
|
|
||||||
this.exec = function(cmd, stdOutPath, stdErrPath) {
|
this.exec = function(cmd, stdOutPath, stdErrPath) {
|
||||||
var stdout, stderr;
|
var stdout, stderr;
|
||||||
var seed = parseInt(Math.random() * 10000);
|
var stdOutPath = (typeof(stdOutPath) === "undefined" ? "tmp\\stdout_" + SEED + ".txt" : stdOutPath);
|
||||||
var stdOutPath = (typeof(stdOutPath) === "undefined" ? "tmp\\stdout_" + seed + ".txt" : stdOutPath);
|
var stdErrPath = (typeof(stdErrPath) === "undefined" ? "tmp\\stderr_" + SEED + ".txt" : stdErrPath);
|
||||||
var stdErrPath = (typeof(stdErrPath) === "undefined" ? "tmp\\stderr_" + seed + ".txt" : stdErrPath);
|
|
||||||
|
|
||||||
var c = "%comspec% /c (" + this.build(cmd) + ") 1> " + stdOutPath;
|
var c = "%comspec% /c (" + this.build(cmd) + ") 1> " + stdOutPath;
|
||||||
//c += " 2>&1";
|
//c += " 2>&1";
|
||||||
|
@ -192,6 +194,6 @@ exports.getPathOfMyDocuments = function() {
|
||||||
return (new ShellObject()).getPathOfMyDocuments();
|
return (new ShellObject()).getPathOfMyDocuments();
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.VERSIONINFO = "Shell interface (shell.js) version 0.2";
|
exports.VERSIONINFO = "Shell interface (shell.js) version 0.3";
|
||||||
exports.global = global;
|
exports.global = global;
|
||||||
exports.require = global.require;
|
exports.require = global.require;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user