Conversation
joakimbeng
left a comment
There was a problem hiding this comment.
This change will be a breaking change, so the commit message should be something more like:
feat: throw error if nothing to inject
BREAKING CHANGE: instead of logging when nothing was injected an error will be thrown
(Side note: I guess you made this PR from the GitHub UI, or locally without running npm install first, because the git hook that validates the commit message apparently hasn't been run. Conventional Commits should be used)
src/inject/index.js
Outdated
| log(cyan(filesCount) + ' file' + pluralState + ' into ' + magenta(target.relative) + '.'); | ||
| } else { | ||
| log('Nothing to inject into ' + magenta(target.relative) + '.'); | ||
| error('Nothing to inject into ' + magenta(target.relative) + '.'); |
There was a problem hiding this comment.
You'll need a throw here as well, otherwise nothing will happen, it won't even log anything...
src/inject/index.js
Outdated
| log(cyan(filesCount) + ' file' + pluralState + ' into ' + magenta(target.relative) + '.'); | ||
| } else { | ||
| log('Nothing to inject into ' + magenta(target.relative) + '.'); | ||
| error('Nothing to inject into ' + magenta(target.relative) + '.'); |
There was a problem hiding this comment.
I also suggest adding a test for this
There was a problem hiding this comment.
Added tests for both error and log if there is nothing to inject
|
Hi @joakimbeng , What about adding an option And yes made the PR from GitHub UI :) |
37ba0c8 to
294ae05
Compare
fbe5cd2 to
eb4a618
Compare
|
Hi @joakimbeng , Please review when you have time. Thanks |
|
Hey @joakimbeng, is there a chance to merge this PR? |
No description provided.