From 627be70c5795dd51f758d1a85b07fc70111eae88 Mon Sep 17 00:00:00 2001 From: Oliver Schwendener Date: Mon, 9 Jul 2018 11:37:31 +0200 Subject: [PATCH] Removed useless encoding statement because utf8 is default anyway --- src/ts/executors/command-line-executor.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ts/executors/command-line-executor.ts b/src/ts/executors/command-line-executor.ts index 6750dfcfe..2dc3a4ce9 100644 --- a/src/ts/executors/command-line-executor.ts +++ b/src/ts/executors/command-line-executor.ts @@ -5,17 +5,16 @@ import { Executor } from "./executor"; import { IpcChannels } from "../ipc-channels"; export class CommandLineExecutor implements Executor { - private encoding = "utf8"; - public execute(executionArgument: string): void { const command = CommandLineHelpers.buildCommand(executionArgument); const commandLineTool = spawn(command.name, command.args); - this.sendCommandLineOutputToRenderer(`Started "${command.name}" with parameters: ${command.args.map((c) => `"${c}"`).join(", ")}`); + const commandLineToolStartedMessage = (command.args !== undefined && command.args.length > 0) + ? `Started "${command.name}" with parameters: ${command.args.map((c) => `"${c}"`).join(", ")}` + : `Started "${command.name}"`; - commandLineTool.stderr.setEncoding(this.encoding); - commandLineTool.stdout.setEncoding(this.encoding); + this.sendCommandLineOutputToRenderer(commandLineToolStartedMessage); commandLineTool.on("error", (err) => { this.sendCommandLineOutputToRenderer(err.message);