Skip to content

Commit

Permalink
Removed useless encoding statement because utf8 is default anyway
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverschwendener committed Jul 9, 2018
1 parent 07a9794 commit 627be70
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/ts/executors/command-line-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 627be70

Please sign in to comment.