Skip to content

Conversation

weaverryan
Copy link
Member

Fixes #112

The updated way avoids triggering the "singleton" behavior or yargs. This is important so that later, when webpack uses yargs, it uses the updated process.argv (because we remove our extra "command" argument so that webpack doesn't see it).

I'm not sure exactly which dep/commit caused the issue, but this a more proper solution anyways.

Also added a smoke test for the encore binary.

removal was no longer working

The cause was possibly in yargs itself. The new way of calling out to
yargs from our library is more proper anyways.
);

const binPath = path.resolve(__dirname, '../', '../', 'bin', 'encore.js');
exec(`node ${binPath} dev --context=${testDir}`, { cwd: testDir }, (err, stdout, stderr) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the 2 paths need to be escaped as they could contain spaces

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - I just pushed an imperfect escape at sha: 172a670120e79dd6b5f6aaa65845f9892b982ea0 - which is good enough for test paths I think :)

@weaverryan weaverryan deleted the fixing-argv-extra-args branch July 26, 2017 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants