Skip to content

Commit

Permalink
feat(utils/exec): spawns w/ project directory as cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
rafamel committed Apr 23, 2019
1 parent 2806e0c commit ab692bc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/utils/exec/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { rejects } from 'errorish';
import getEnv from './get-env';
import onExit from 'signal-exit';
import uuid from 'uuid/v4';
import state from '~/state';
import { IOfType } from '~/types';

export const processes: IOfType<ChildProcess> = {};
Expand All @@ -21,6 +22,7 @@ export default async function exec(
opts.shell = true;
if (!opts.stdio) opts.stdio = DEFAULT_STDIO;
if (!opts.env) opts.env = await getEnv();
if (!opts.cwd) opts.cwd = (await state.paths()).directory;

logger.debug('Executing: ' + command);
const id = uuid();
Expand Down

0 comments on commit ab692bc

Please sign in to comment.