Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Cloud7050 opened this issue Jul 18, 2019 · 3 comments

Comments

@Cloud7050
Copy link

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));
@threequartersjohn
Copy link

threequartersjohn commented Jul 31, 2019

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

@Cloud7050
Copy link
Author

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

@threequartersjohn
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants