Skip to content

Commit

Permalink
police: add the force parameter
Browse files Browse the repository at this point in the history
In some cases you may have npm modules that aren't in the public npm
module database. Add the -f flag to continue running even if that is the
case.
  • Loading branch information
Brandon Philips committed Nov 29, 2011
1 parent d2d30b8 commit 44927fc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/police.js
Expand Up @@ -68,6 +68,13 @@ police.start = function (argv, callback) {
police.auth.logout();
}

/*
* Set force parameter
*/
if (argv.force || argv.f) {
police.force = true;
}

/*
* Reads a local file and checks it
*/
Expand Down
4 changes: 4 additions & 0 deletions lib/police/check.js
Expand Up @@ -110,6 +110,10 @@ check.npm = function (dep, callback) {
if (res.statusCode==404) {
police.winston.warn('Module is MIA (missing in action)'.red.bold);
police.winston.warn(res.request.uri.href.red);
if (police.force) {
callback();
return;
}
callback(1);
} else {
body = JSON.parse(body);
Expand Down
1 change: 1 addition & 0 deletions lib/police/help.js
Expand Up @@ -51,6 +51,7 @@ help.usage = [
'Miscellaneous police flags'.cyan.bold,
'',

' --force, -f Continue running even if errors are encountered',
' --destroy, -d Destroys exisiting authentication',
' --conf [FILE] Sets the configuraiton file to be used',
' --version, -v Displays version',
Expand Down

0 comments on commit 44927fc

Please sign in to comment.