Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(findBin): Add separator before npm args #297

Merged
merged 1 commit into from
Sep 25, 2017
Merged

Conversation

sudo-suhas
Copy link
Collaborator

Closes #296.

@codecov
Copy link

codecov bot commented Sep 23, 2017

Codecov Report

Merging #297 into master will decrease coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #297      +/-   ##
==========================================
- Coverage    91.9%   91.86%   -0.05%     
==========================================
  Files          10       10              
  Lines         173      172       -1     
  Branches       27       26       -1     
==========================================
- Hits          159      158       -1     
  Misses         13       13              
  Partials        1        1
Impacted Files Coverage Δ
src/runScript.js 100% <100%> (ø) ⬆️
src/findBin.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1dc3bd6...9bb4d3f. Read the comment docs.

@@ -8,25 +8,25 @@ describe('findBin', () => {
it('should favor `npm run` command if exists in both package.json and .bin/', () => {
const { bin, args } = findBin('my-linter', { 'my-linter': 'my-linter' })
expect(bin).toEqual('npm')
expect(args).toEqual(['run', '--silent', 'my-linter'])
expect(args).toEqual(['run', '--silent', 'my-linter', '--'])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we only add this if there are arguments?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought of that.. we need it cause we pass file names later on.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh gotcha. We should a comment then for future us :)

@@ -24,16 +24,14 @@ module.exports = function runScript(commands, pathsToLint, scripts, config) {
try {
const res = findBin(linter, scripts, config)

const separatorArgs = /npm(\.exe)?$/i.test(res.bin) ? ['--'] : []
Copy link
Collaborator

Choose a reason for hiding this comment

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

It’s good this is gone. I hated it here

@okonet
Copy link
Collaborator

okonet commented Sep 23, 2017

LGTM but see my comments

@sudo-suhas
Copy link
Collaborator Author

@okonet Shall we merge this in?

@sudo-suhas
Copy link
Collaborator Author

Merging this in as @okonet is probably busy at the conference.

@sudo-suhas sudo-suhas merged commit 065f362 into master Sep 25, 2017
@sudo-suhas sudo-suhas deleted the fix/npm-args-sep branch September 25, 2017 04:12
@okonet
Copy link
Collaborator

okonet commented Sep 25, 2017

Thanks!

@sudo-suhas
Copy link
Collaborator Author

Ok. I'll add a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants