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
{{ message }}
Repository navigation
Provide better error output when file doesn't exist #8546
But it's not clear what "invalid" means in this case. It could mean, for example, that the filename itself is somehow invalid. I think something like this would be preferable:
Error:
× Invalid move operation
╭─[entry #1:1:1]
1 │ mv foo.txt bar.txt
· ───┬───
· ╰── file or directory does not exist
╰────
How to reproduce
nu -c "mv definitely-does-not-exist.txt some-other-filename.txt"
Expected behavior
I'd expect something at least as helpful as what you get from Bash et al:
mv: cannot stat 'foo.txt': No such file or directory
I lean toward "files" for succinctness. "files or directories" would be more correct, but I think that's unnecessary; if I saw "file not found" when trying to copy a directory I would know what it means and wouldn't think twice about it.
Activity
rgwood commentedon Mar 23, 2023
Good issue, thanks. How's this for alternate wording?
lucperkins commentedon Mar 23, 2023
@rgwood Yup, seems like an improvement to me! Should it be "files or directories," though? (I'm honestly not sure...not a rhetorical question!)
rgwood commentedon Mar 23, 2023
I lean toward "files" for succinctness. "files or directories" would be more correct, but I think that's unnecessary; if I saw "file not found" when trying to copy a directory I would know what it means and wouldn't think twice about it.
But yeah, could go either way.
Better error message for `mv` when file not found (#8586)