trash icon indicating copy to clipboard operation
trash copied to clipboard

Trash with globs exclusion needs to be passed array of paths from Globby

Open Cloud7050 opened this issue 5 years ago • 3 comments

When running this code:

	let trashArr = [
		"./public/img",
		"!./public/img/*/**"
	];
	Trash(trashArr);

I get this error:

(node:15172) UnhandledPromiseRejectionWarning: Error: Command failed: D:\x\node_modules\trash\lib\windows-trash.exe D:\x\public\img

    at ChildProcess.exithandler (child_process.js:275:12)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

But this code works as expected:

	let trashArr = [
		"./public/img",
		"!./public/img/*/**"
	];
	Globby(trashArr).then(paths => Trash(paths));

Cloud7050 avatar Jul 18 '19 20:07 Cloud7050

I was able to run your example code without errors, would you mind adding some information to help replicate this situation?

threequartersjohn avatar Jul 31 '19 16:07 threequartersjohn

Hello, thanks for the response. May I know what additional information I can provide that would help?

Cloud7050 avatar Aug 01 '19 06:08 Cloud7050

I would think packages and node versions, and operating system.

threequartersjohn avatar Aug 01 '19 12:08 threequartersjohn