Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@gagan-bansal

Description

@gagan-bansal

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.

$ 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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bash compatCompatibility issues with bash or POSIX behaviorfixBug/defect, or a fix for such a problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions