Updated readme, version, code style
This commit is contained in:
parent
43ffe0e979
commit
5a6372fe46
3 changed files with 8 additions and 6 deletions
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
var fs = require("fs");
|
||||
|
||||
/* wrench.rmdirSyncRecursive("directory_path", failSilent);
|
||||
/* wrench.rmdirSyncRecursive("directory_path", forceDelete, failSilent);
|
||||
*
|
||||
* Recursively dives through directories and obliterates everything about it. This is a
|
||||
* Sync-function, which blocks things until it's done. No idea why anybody would want an
|
||||
|
|
@ -21,9 +21,11 @@ var fs = require("fs");
|
|||
*/
|
||||
exports.rmdirSyncRecursive = function(path, failSilent) {
|
||||
var files;
|
||||
try { files = fs.readdirSync(path); }
|
||||
catch (err) {
|
||||
if (failSilent) return;
|
||||
|
||||
try {
|
||||
files = fs.readdirSync(path);
|
||||
} catch (err) {
|
||||
if(failSilent) return;
|
||||
throw new Error(err.message);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "wrench",
|
||||
"description": "Recursive filesystem (and other) operations that Node *should* have.",
|
||||
"version": "1.3.2",
|
||||
"version": "1.3.3",
|
||||
"author": "Ryan McGrath <ryan@venodesigns.net>",
|
||||
|
||||
"repository": {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ var wrench = require('wrench'),
|
|||
wrench.mkdirSyncRecursive(dir, 0777);
|
||||
|
||||
// Recursively delete the entire sub-tree of a directory, then kill the directory
|
||||
wrench.rmdirSyncRecursive('my_directory_name');
|
||||
wrench.rmdirSyncRecursive('my_directory_name', failSilently);
|
||||
|
||||
// Recursively chmod the entire sub-tree of a directory
|
||||
wrench.chmodSyncRecursive('my_directory_name', 0755);
|
||||
|
|
|
|||
Reference in a new issue