mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-03-12 00:45:14 +00:00
Update shell.js
This commit is contained in:
parent
4bd7beb5ca
commit
3d4f9c3512
13
lib/shell.js
13
lib/shell.js
|
@ -8,11 +8,13 @@ var SEED = RAND.getSeed();
|
||||||
|
|
||||||
var ShellObject = function() {
|
var ShellObject = function() {
|
||||||
this.interface = null;
|
this.interface = null;
|
||||||
|
|
||||||
this.currentDirectory = null;
|
this.currentDirectory = null;
|
||||||
this.workingDirectory = null;
|
this.workingDirectory = null;
|
||||||
this.isElevated = false;
|
this.isElevated = false;
|
||||||
this.isFork = false;
|
this.isFork = false;
|
||||||
this.isVisibleWindow = false;
|
this.isVisibleWindow = false;
|
||||||
|
this.charset = "utf-8";
|
||||||
|
|
||||||
this.stdout = null;
|
this.stdout = null;
|
||||||
this.stderr = null;
|
this.stderr = null;
|
||||||
|
@ -82,12 +84,12 @@ var ShellObject = function() {
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
|
||||||
if (FILE.fileExists(stdOutPath)) {
|
if (FILE.fileExists(stdOutPath)) {
|
||||||
stdout = FILE.readFile(stdOutPath, "utf-8");
|
stdout = FILE.readFile(stdOutPath, this.charset);
|
||||||
FILE.deleteFile(stdOutPath);
|
FILE.deleteFile(stdOutPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FILE.fileExists(stdErrPath)) {
|
if (FILE.fileExists(stdErrPath)) {
|
||||||
stderr = FILE.readFile(stdErrPath, "utf-8");
|
stderr = FILE.readFile(stdErrPath, this.charset);
|
||||||
FILE.deleteFile(stdErrPath);
|
FILE.deleteFile(stdErrPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,6 +150,11 @@ var ShellObject = function() {
|
||||||
this.interface = null;
|
this.interface = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.setCharset = function(charset) {
|
||||||
|
this.charset = charset;
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
this.create();
|
this.create();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -194,6 +201,6 @@ exports.getPathOfMyDocuments = function() {
|
||||||
return (new ShellObject()).getPathOfMyDocuments();
|
return (new ShellObject()).getPathOfMyDocuments();
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.VERSIONINFO = "Shell interface (shell.js) version 0.3";
|
exports.VERSIONINFO = "Shell interface (shell.js) version 0.3.1";
|
||||||
exports.global = global;
|
exports.global = global;
|
||||||
exports.require = global.require;
|
exports.require = global.require;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user