#1146·shelljs

In mv command, there should be en error if destination directory not present.

Author: gagan-bansalCreated Dec 27, 2023Updated Dec 27, 2023
Labelsfixbash compat

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.

bash
$ touch test-file.txt
$ mv test-file.txt /path/doesnot/exist/
mv: cannot move 'test-file.txt' to '/path/doesnot/exist/': No such file or directory

Javascript:

javascript
const shell = require('shelljs')
var resp = shell.mv('./test-file.txt', '/path/doesnot/exist/')
console.log(resp.stderr)
// null