Report forgotten errors from 'mv' by vgalka-sl · Pull Request #879 · shelljs/shelljs · GitHub
Skip to content

Report forgotten errors from 'mv'#879

Open
vgalka-sl wants to merge 2 commits into
shelljs:mainfrom
vgalka-sl:mv-errors
Open

Report forgotten errors from 'mv'#879
vgalka-sl wants to merge 2 commits into
shelljs:mainfrom
vgalka-sl:mv-errors

Conversation

@vgalka-sl

Copy link
Copy Markdown

Fix for issue #878.

@codecov-io

codecov-io commented Jul 23, 2018

Copy link
Copy Markdown

@nfischer nfischer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you please add a test in test/mv.js? Your example in #878 with foo/a/file.js sounds perfect.

Comment thread src/mv.js
cp('-r', src, thisDest);
rm('-rf', src);
} else {
common.error(e.message, { continue: true });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you catch a specific e.code and output a message like mv: cannot move 'foo/a/file.js' to 'bar/a/file.js': No such file or directory?

Also, could you add an else branch with throw e? The distinction is that we only want to use common.error() for expected error conditions, and would prefer to fail loudly with an exception for unexpected conditions (so that we can fix these as they're reported).

@nfischer nfischer added fix Bug/defect, or a fix for such a problem bash compat Compatibility issues with bash or POSIX behavior labels Jul 23, 2018
@nfischer nfischer added this to the v0.8.x milestone Jul 23, 2018
@nfischer

nfischer commented Aug 1, 2018

Copy link
Copy Markdown
Member

@nfischer nfischer removed this from the v0.8.x milestone Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bash compat Compatibility issues with bash or POSIX behavior fix Bug/defect, or a fix for such a problem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants