Last 12 weeks · 6 commits
4 of 6 standards met
Repository: sindresorhus/trash-cli. Description: Move files and folders to the trash Stars: 1386, Forks: 37. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Latest release: v7.2.0 (1mo ago). Open PRs: 0, open issues: 2. Last activity: 1mo ago. Community health: 85%. Top contributors: sindresorhus, jv-k, MoOx, Richienb.
Description silently fails to trash directories. The command returns exit code 0 but nothing is moved to trash. Steps to Reproduce ```bash mkdir test-folder echo "test" > test-folder/test.txt trash test-folder ls test-folder # folder still exists With --verbose, no output is produced either: trash -v test-folder (no output, folder still exists) Expected Behavior The directory should be moved to the trash. Actual Behavior The directory is silently ignored. Exit code is 0, no error message, no verbose output. Root Cause In cli.js line 49: const files = await globby(cli.input, {expandDirectories: false}); globby defaults to onlyFiles: true, which excludes directories from the results. When a directory path is passed, globby returns an empty array, so nothing gets trashed. Fix Add onlyFiles: false to the globby options: const files = await globby(cli.input, {expandDirectories: false, onlyFiles: false}); Environment trash-cli: 7.1.0 Node.js: v25.4.0 macOS: Tahoe 26.2 (25C56)