Comparing version 5.0.1 to 5.1.0
19
cli.js
@@ -6,2 +6,10 @@ #!/usr/bin/env node | ||
const logEvent = event => { | ||
if (event.path !== undefined) { | ||
console.log(event.path); | ||
} | ||
}; | ||
const noop = () => {}; | ||
const cli = meow(` | ||
@@ -14,2 +22,3 @@ Usage | ||
--dry-run, -d List what would be deleted instead of deleting | ||
--verbose, -v Display the absolute path of files and directories as they are deleted | ||
@@ -30,2 +39,6 @@ Examples | ||
}, | ||
verbose: { | ||
type: 'boolean', | ||
alias: 'v', | ||
}, | ||
}, | ||
@@ -38,4 +51,8 @@ }); | ||
} else { | ||
const files = await deleteAsync(cli.input, cli.flags); | ||
const {verbose, ...flags} = cli.flags; | ||
const onProgress = verbose ? logEvent : noop; | ||
const files = await deleteAsync(cli.input, {onProgress, ...flags}); | ||
if (cli.flags.dryRun) { | ||
@@ -42,0 +59,0 @@ console.log(files.join('\n')); |
{ | ||
"name": "del-cli", | ||
"version": "5.0.1", | ||
"version": "5.1.0", | ||
"description": "Delete files and directories - Cross-platform", | ||
@@ -53,3 +53,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"del": "^7.0.0", | ||
"del": "^7.1.0", | ||
"meow": "^10.1.3" | ||
@@ -61,4 +61,4 @@ }, | ||
"temp-write": "^5.0.0", | ||
"xo": "^0.50.0" | ||
"xo": "^0.56.0" | ||
} | ||
} |
@@ -26,2 +26,3 @@ # del-cli | ||
--dry-run, -d List what would be deleted instead of deleting | ||
--verbose, -v Display the absolute path of files and directories as they are deleted | ||
@@ -28,0 +29,0 @@ Examples |
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
4613
48
46
Updateddel@^7.1.0