Skip to content

Commit

Permalink
Ability to run commands with multiple spaces
Browse files Browse the repository at this point in the history
Signed-off-by: Gnanakeethan Balasubramaniam <[email protected]>
  • Loading branch information
gnanakeethan committed Sep 11, 2023
1 parent d170c04 commit cb71aca
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/shell-imp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,13 @@ export class ShellModel implements IImpactModelInterface {
private runModelInShell(input: string, execPath: string): KeyValuePair {
try {
console.log('input', input);
const execs = execPath.split(' ');
const executable = execs.pop() ?? '';
const result = cp
.spawnSync(execPath, ['--calculate'], {input: input, encoding: 'utf8'})
.spawnSync(executable, [...execs, '--calculate'], {
input: input,
encoding: 'utf8',
})
.stdout.toString();
console.log('result', result);
return yaml.load(result) as KeyValuePair;
Expand Down

0 comments on commit cb71aca

Please sign in to comment.