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
4bd7beb5ca
commit
3d4f9c3512
15
lib/shell.js
15
lib/shell.js
|
@ -8,12 +8,14 @@ var SEED = RAND.getSeed();
|
|||
|
||||
var ShellObject = function() {
|
||||
this.interface = null;
|
||||
|
||||
this.currentDirectory = null;
|
||||
this.workingDirectory = null;
|
||||
this.isElevated = false;
|
||||
this.isFork = false;
|
||||
this.isVisibleWindow = false;
|
||||
|
||||
this.charset = "utf-8";
|
||||
|
||||
this.stdout = null;
|
||||
this.stderr = null;
|
||||
|
||||
|
@ -82,12 +84,12 @@ var ShellObject = function() {
|
|||
sleep(1);
|
||||
|
||||
if (FILE.fileExists(stdOutPath)) {
|
||||
stdout = FILE.readFile(stdOutPath, "utf-8");
|
||||
stdout = FILE.readFile(stdOutPath, this.charset);
|
||||
FILE.deleteFile(stdOutPath);
|
||||
}
|
||||
|
||||
if (FILE.fileExists(stdErrPath)) {
|
||||
stderr = FILE.readFile(stdErrPath, "utf-8");
|
||||
stderr = FILE.readFile(stdErrPath, this.charset);
|
||||
FILE.deleteFile(stdErrPath);
|
||||
}
|
||||
|
||||
|
@ -148,6 +150,11 @@ var ShellObject = function() {
|
|||
this.interface = null;
|
||||
};
|
||||
|
||||
this.setCharset = function(charset) {
|
||||
this.charset = charset;
|
||||
return this;
|
||||
};
|
||||
|
||||
this.create();
|
||||
};
|
||||
|
||||
|
@ -194,6 +201,6 @@ exports.getPathOfMyDocuments = function() {
|
|||
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.require = global.require;
|
||||
|
|
Loading…
Reference in New Issue
Block a user