Conversation
Also fixes a typo
Also fixes a typo
Also fixes a typo
We also had a test which called sort() instead of uniq(), so we never actually tested the missing-file case. This fixes that as well. This also throws an error for using a directory as output.
Codecov Report
@@ Coverage Diff @@
## master #713 +/- ##
==========================================
+ Coverage 94.66% 94.76% +0.09%
==========================================
Files 33 33
Lines 1219 1241 +22
==========================================
+ Hits 1154 1176 +22
Misses 65 65
Continue to review full report at Codecov.
|
freitagbr
requested changes
May 3, 2017
| if (file !== '-') { | ||
| if (!fs.existsSync(file)) { | ||
| common.error('no such file or directory: ' + file, { continue: true }); | ||
| return; |
Contributor
There was a problem hiding this comment.
Are these return statements necessary? common.error throws an error, so the function should exit there.
Member
Author
There was a problem hiding this comment.
It doesn't throw an error with continue: true
Member
Author
|
@freitagbr PTAL |
Contributor
|
LGTM |
freitagbr
approved these changes
May 9, 2017
This was referenced Aug 29, 2019
This was referenced Mar 24, 2020
This was referenced Apr 24, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We previously did not handle directories very well for many of our commands (would immediately error out). This fixes that.
cat(): did not handle directories as inputs, now it gracefully errorshead(): same thing. It also had a typo in a test.sort(): same thing. It had the same typo.tail(): same bug, and same typo.uniq(): did not handle directories as inputs. Did not handle directories as outputs. Did not handle non-existent inputs (this slipped through because of a test typo). All are treated as errors.Fixes #707