Skip to content

Commit

Permalink
fix(core): ensure execoFile process runs with shell
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Mar 22, 2022
1 parent b23ad2d commit 979f975
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 2 additions & 0 deletions packages/web/src/executors/file-server/file-server.impl.ts
Expand Up @@ -118,6 +118,7 @@ export default async function* fileServerExecutor(
const [cmd, ...args] = getBuildTargetCommand(options);
execFileSync(cmd, args, {
stdio: [0, 1, 2],
shell: true,
});
} catch {}
running = false;
Expand All @@ -134,6 +135,7 @@ export default async function* fileServerExecutor(

const serve = execFile('npx', ['http-server', outputPath, ...args], {
cwd: context.root,
shell: true,
env: {
FORCE_COLOR: 'true',
...process.env,
Expand Down
21 changes: 13 additions & 8 deletions packages/workspace/src/tasks-runner/cache.ts
Expand Up @@ -190,14 +190,19 @@ export class Cache {
}

return new Promise((res, rej) => {
execFile('cp', ['-a', src, dirname(directory)], (error) => {
if (!error) {
res();
} else {
this.useFsExtraToCopyAndRemove = true;
copy(src, directory).then(res, rej);
execFile(
'cp',
['-a', src, dirname(directory)],
{ shell: true },
(error) => {
if (!error) {
res();
} else {
this.useFsExtraToCopyAndRemove = true;
copy(src, directory).then(res, rej);
}
}
});
);
});
}

Expand All @@ -207,7 +212,7 @@ export class Cache {
}

return new Promise<void>((res, rej) => {
execFile('rm', ['-rf', folder], (error) => {
execFile('rm', ['-rf', folder], { shell: true }, (error) => {
if (!error) {
res();
} else {
Expand Down

0 comments on commit 979f975

Please sign in to comment.