reduce memory footprint by reusing object instances

Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
Travis Glenn Hansen
2022-04-06 11:14:39 -06:00
parent 1783aebb75
commit 1f2c8cf58d
19 changed files with 412 additions and 229 deletions
+5 -5
View File
@@ -610,17 +610,17 @@ class Filesystem {
const filesystem = this;
args = args || [];
let stdout = "";
let stderr = "";
if (filesystem.options.sudo) {
args.unshift(command);
command = filesystem.options.paths.sudo;
}
console.log("executing filesystem command: %s %s", command, args.join(" "));
const child = filesystem.options.executor.spawn(command, args, options);
return new Promise((resolve, reject) => {
const child = filesystem.options.executor.spawn(command, args, options);
let stdout = "";
let stderr = "";
child.stdout.on("data", function (data) {
stdout = stdout + data;
});