fix(core): update

This commit is contained in:
2021-07-26 21:24:13 +02:00
parent 0199160013
commit db712b2223
11 changed files with 24581 additions and 712 deletions

View File

@ -31,7 +31,7 @@ export class ShellEnv {
/**
* imports path into the shell from env if available and returns it with
*/
private _setPath(commandStringArg): string {
private _setPath(commandStringArg: string): string {
let commandResult = commandStringArg;
let commandPaths: string[] = [];
commandPaths = commandPaths.concat(process.env.PATH.split(':'));
@ -41,7 +41,7 @@ export class ShellEnv {
// lets filter for unwanted paths
// Windows WSL
commandPaths = commandPaths.filter(commandPathArg => {
commandPaths = commandPaths.filter((commandPathArg) => {
const filterResult =
!commandPathArg.startsWith('/mnt/c/') &&
!commandPathArg.startsWith('Files/1E') &&

View File

@ -71,18 +71,6 @@ export class Smartshell {
spawnlogInstance.addToBuffer(data);
});
if (streamingArg) {
done.resolve({
childProcess: execChildProcess,
finalPromise: childProcessEnded.promise,
kill: () => {
// this notation with the - kills the whole process group
console.log(`running tree kill on process ${execChildProcess.pid}`);
plugins.treeKill(execChildProcess.pid);
},
});
}
execChildProcess.on('exit', (code, signal) => {
this.smartexit.removeProcess(execChildProcess);
if (strictArg && code === 1) {
@ -100,6 +88,18 @@ export class Smartshell {
childProcessEnded.resolve(execResult);
});
if (streamingArg) {
done.resolve({
childProcess: execChildProcess,
finalPromise: childProcessEnded.promise,
kill: () => {
// this notation with the - kills the whole process group
console.log(`running tree kill on process ${execChildProcess.pid}`);
plugins.treeKill(execChildProcess.pid);
},
});
}
const result = await done.promise;
return result;
}