Update shell.js

This commit is contained in:
Namhyeon Go 2022-09-22 14:35:15 +09:00 committed by GitHub
parent 4bd7beb5ca
commit 3d4f9c3512
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;