mem-fs-editor icon indicating copy to clipboard operation
mem-fs-editor copied to clipboard

Check for multiple src files in copy.js

Open dangomania opened this issue 8 months ago • 0 comments

I noticed that when directory is passed as the src_path for copy.js, copy.js does not work as intended on NetBSD.

The copy.js checks the src_path with (Array.isArray(from) || !this.exists(from) || (globby.hasMagic(normalize(from)) && !options.noGlob), and !this.exists(from) returns null when "from" is a dir on Linux, but it returns non-null value (string representing files contained in the dir) on NetBSD.

This is because the behavior of "file.contents" used in exists.js differs on these platforms.

it seems that "fs.statSync(from).isDirectory()" should be added to the above condition so that copy.js works as intended on both platforms.

dangomania avatar May 27 '24 10:05 dangomania