You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
gagan-bansal
changed the title
In mv command, there should be en error if destination not present.
In mv command, there should be en error if destination directory not present.
Dec 27, 2023
I agree, this should ideally return an error. Some comments about this:
mv test-file.txt does-not-exist/ should throw an error because does-not-exist/ must be interpreted as a folder (due to the trialing slash). This is the case which is broken in shelljs: the behavior is actually correct (it does not copy the file), but it needs to print an error message about the issue.
mv test-directory does-not-exist/ should not throw an error; test-directory is a directory, so it will be renamed to a directory named does-not-exist. This case works as expected in shelljs.
mv test-file.txt other-test-file.txt does-not-exist is supposed to throw an error; if there are 3 arguments, then the last argument must be a folder which already exists. This case works as expected in shelljs.
Node version (or tell us if you're using electron or some other framework):
node version: v18.17.1
ShellJS version (the most recent version/Github branch you see the bug on):
ShellJS version: 0.8.5
Operating system:
Ubuntu 23.04
Description of the bug:
In
mv
command if the destination directory does not exist, the stderr should have the error message.Example ShellJS command to reproduce the error:
On linux shell, there is an error message.
Javascript:
The text was updated successfully, but these errors were encountered: