Skip to content

Commit

Permalink
Added utf-8 encoding for commandline plugin (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverschwendener committed Jul 2, 2018
1 parent 8c2c0cb commit a8679aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ts/executors/command-line-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@ import { Executor } from "./executor";
import { IpcChannels } from "../ipc-channels";

export class CommandLineExecutor implements Executor {
private encoding = "utf-8";

public execute(executionArgument: string): void {
const command = CommandLineHelpers.buildCommand(executionArgument);

const commandLineTool = spawn(command.name, command.args);

commandLineTool.stderr.setEncoding(this.encoding);
commandLineTool.stdout.setEncoding(this.encoding);

commandLineTool.on("error", (err) => {
this.sendCommandLineOutputToRenderer(err.message);
});
Expand Down

0 comments on commit a8679aa

Please sign in to comment.