diff --git a/src/shell/CommandExecutor.ts b/src/shell/CommandExecutor.ts index 489a0cde9..51d0add7d 100644 --- a/src/shell/CommandExecutor.ts +++ b/src/shell/CommandExecutor.ts @@ -25,18 +25,12 @@ class BuiltInCommandExecutionStrategy extends CommandExecutionStrategy { } startExecution() { - console.log('startExecution 1'); return new Promise((resolve, reject) => { try { - console.log('startExecution 2'); Command.executor(this.job.prompt.commandName)(this.job, this.job.prompt.arguments.map(token => token.value)); - console.log('startExecution 3'); resolve(); - console.log('startExecution 4'); } catch (error) { - console.log('startExecution 5'); reject(error.message); - console.log('startExecution 6'); } }); } @@ -63,20 +57,14 @@ class ShellExecutionStrategy extends CommandExecutionStrategy { } startExecution() { - console.log('ShellExecutionStrategy.startExecution 1'); return new Promise((resolve, reject) => { - console.log('ShellExecutionStrategy.startExecution 2'); this.job.setPty(new PTY( this.job.prompt.expandedTokens.map(token => token.escapedValue), this.job.environment.toObject(), this.job.dimensions, - (data: string) => { - console.log('ShellExecutionStrategy.startExecution 4'); - this.job.parser.parse(data) - }, + (data: string) => this.job.parser.parse(data), (exitCode: number) => exitCode === 0 ? resolve() : reject(new NonZeroExitCodeError(exitCode.toString())), )); - console.log('ShellExecutionStrategy.startExecution 3'); }); } } @@ -87,9 +75,7 @@ class WindowsShellExecutionStrategy extends CommandExecutionStrategy { } startExecution() { - console.log('WindowsShellExecutionStrategy.startExecution 1'); return new Promise((resolve) => { - console.log('WindowsShellExecutionStrategy.startExecution 2'); this.job.setPty(new PTY( [ this.cmdPath, @@ -123,18 +109,11 @@ export class CommandExecutor { ]; static async execute(job: Job): Promise<{}> { - console.log('CommandExecutor.execute 1'); const applicableExecutors = await filterAsync(this.executors, executor => executor.canExecute(job)); - console.log('CommandExecutor.execute 2'); - console.log('applicableExecutors', applicableExecutors[0]); if (applicableExecutors.length) { - console.log('CommandExecutor.execute 3'); - const x = new applicableExecutors[0](job); - console.log('CommandExecutor.execute 3.1'); - return x.startExecution(); + return new applicableExecutors[0](job).startExecution(); } else { - console.log('CommandExecutor.execute 4'); throw `Black Screen: command "${job.prompt.commandName}" not found.\n`; } }