Skip to content

Commit

Permalink
Separate args to avoid spaces issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jneira committed Aug 4, 2021
1 parent e799472 commit 61d8e3f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/hlsBinaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ async function getProjectGhcVersion(
},
async (progress, token) => {
return new Promise<string>((resolve, reject) => {
const command: string = wrapper + ' --project-ghc-version';
const args = ['--project-ghc-version'];
const command: string = wrapper + args.join(' ');
logger.info(`Executing '${command}' in cwd '${dir}' to get the project or file ghc version`);
token.onCancellationRequested(() => {
logger.warn(`User canceled the execution of '${command}'`);
Expand All @@ -124,7 +125,8 @@ async function getProjectGhcVersion(
// We execute the command in a shell for windows, to allow use .cmd or .bat scripts
const childProcess = child_process
.execFile(
command,
wrapper,
args,
{ encoding: 'utf8', cwd: dir, shell: getGithubOS() === 'Windows' },
(err, stdout, stderr) => {
if (err) {
Expand Down

0 comments on commit 61d8e3f

Please sign in to comment.