Permalink
Browse files

make it possible to change npm register

  • Loading branch information...
1 parent 2fbf0d1 commit f4969bbe541ad1ca4a97689c301968825388f27f @tellnes tellnes committed Jan 5, 2013
Showing with 6 additions and 1 deletion.
  1. +5 −0 lib/police.js
  2. +1 −1 lib/police/check.js
View
@@ -99,6 +99,11 @@ police.start = function (argv, callback) {
}
/*
+ * Set registry parameter
+ */
+ police.registry = argv.registry || police.config.get('registry') || 'https://registry.npmjs.org/'
+
+ /*
* Reads a local file and checks it
*/
if (argv.l) {
View
@@ -140,7 +140,7 @@ check.add = function (name, version, dev) {
* Get version for the npm package
*/
check.npm = function (dep, callback) {
- police.request.get('https://registry.npmjs.org/' + dep.name + '/latest', function (err, res, body) {
+ police.request.get(police.registry + dep.name + '/latest', function (err, res, body) {
if (err) police.exit(err);
if (res.statusCode==404) {
police.winston.warn('Module is MIA (missing in action)'.red.bold);

0 comments on commit f4969bb

Please sign in to comment.