Comparing version 1.2.0 to 1.3.0
14
cli.js
@@ -10,3 +10,3 @@ #!/usr/bin/env node | ||
'Usage', | ||
' trash <path> [<path> ...]', | ||
' trash [--force] <path> [<path> ...]', | ||
'', | ||
@@ -17,5 +17,8 @@ 'Example', | ||
}, { | ||
string: ['_'] | ||
string: ['_'], | ||
boolean: ['force'] | ||
}); | ||
var errExitCode = cli.flags.force ? 0 : 1; | ||
updateNotifier({ | ||
@@ -26,7 +29,12 @@ packageName: cli.pkg.name, | ||
if (cli.input.length === 0) { | ||
console.error('You need to specify at least one path'); | ||
process.exit(errExitCode); | ||
} | ||
trash(cli.input, function (err) { | ||
if (err) { | ||
console.error(err.message); | ||
process.exit(1); | ||
process.exit(errExitCode); | ||
} | ||
}); |
{ | ||
"name": "trash", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Cross-platform command-line app for moving files and directories to the trash - A safer alternative to `rm`", | ||
@@ -45,3 +45,3 @@ "license": "MIT", | ||
"escape-string-applescript": "^1.0.0", | ||
"meow": "^1.0.0", | ||
"meow": "^2.0.0", | ||
"run-applescript": "^1.0.0", | ||
@@ -48,0 +48,0 @@ "update-notifier": "^0.2.1", |
@@ -23,3 +23,3 @@ # ![trash](https://cdn.rawgit.com/sindresorhus/trash/3aa70853f1efb58d0d2512e32d617d246c88953c/media/logo.svg) | ||
Usage | ||
trash <path> [<path> ...] | ||
trash [--force] <path> [<path> ...] | ||
@@ -32,3 +32,11 @@ Example | ||
The `--force` option makes it always succeed even on errors by exiting with code `1`: | ||
```sh | ||
$ trash --force build && BUILDSTUFF | ||
``` | ||
This can be useful when used in platform agnostic scripts like [`npm` package.json scripts](https://docs.npmjs.com/misc/scripts), as eg. `trash build; BUILDSTUFF` doesn't work on Windows. | ||
## API | ||
@@ -35,0 +43,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58178
7
80
84
+ Addedmeow@2.1.0(transitive)
- Removedmeow@1.0.0(transitive)
- Removedobject-assign@1.0.0(transitive)
Updatedmeow@^2.0.0