Updated readme, version, code style

This commit is contained in:
Ryan McGrath 2012-01-13 09:55:49 -05:00
parent 43ffe0e979
commit 5a6372fe46
3 changed files with 8 additions and 6 deletions

View file

@ -13,7 +13,7 @@
var fs = require("fs"); 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 * 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 * 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) { exports.rmdirSyncRecursive = function(path, failSilent) {
var files; var files;
try { files = fs.readdirSync(path); }
catch (err) { try {
if (failSilent) return; files = fs.readdirSync(path);
} catch (err) {
if(failSilent) return;
throw new Error(err.message); throw new Error(err.message);
} }

View file

@ -1,7 +1,7 @@
{ {
"name": "wrench", "name": "wrench",
"description": "Recursive filesystem (and other) operations that Node *should* have.", "description": "Recursive filesystem (and other) operations that Node *should* have.",
"version": "1.3.2", "version": "1.3.3",
"author": "Ryan McGrath <ryan@venodesigns.net>", "author": "Ryan McGrath <ryan@venodesigns.net>",
"repository": { "repository": {

View file

@ -23,7 +23,7 @@ var wrench = require('wrench'),
wrench.mkdirSyncRecursive(dir, 0777); wrench.mkdirSyncRecursive(dir, 0777);
// Recursively delete the entire sub-tree of a directory, then kill the directory // 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 // Recursively chmod the entire sub-tree of a directory
wrench.chmodSyncRecursive('my_directory_name', 0755); wrench.chmodSyncRecursive('my_directory_name', 0755);