Permalink
Browse files

[dist] moar JSHint stuff

  • Loading branch information...
1 parent f3d17d4 commit 25fedaf8c1fe487096e060eacdd6a304c04d0086 @alejandro alejandro committed Jun 28, 2012
Showing with 29 additions and 11 deletions.
  1. +5 −5 lib/app.js
  2. +1 −1 lib/apps.js
  3. +20 −2 lib/log.js
  4. +3 −3 lib/npm.js
View
10 lib/app.js
@@ -30,10 +30,10 @@ var cfg = config
// Show the `app` help and usage
function usage() {
- log.info('')
- log.info(' `nodester app <commands>`'.bold + ' help you to interact with your applications on nodester.')
- log.info(' The availble commands are: (Prefixed with nodester <command>) ')
- log.usage('')
+ log.info('');
+ log.info(' `nodester app <commands>`'.bold + ' help you to interact with your applications on nodester.');
+ log.info(' The availble commands are: (Prefixed with nodester <command>) ');
+ log.usage('');
log.usage('\tapp or <appname> \t\t\t- is not required if inside an app directory after you call setup');
log.usage('\tapp create <appname> <startfile> \t- Creates a new app named <appname>, <startfile> is optional. (default to `server.js`)');
log.usage('\tapp init <appname> \t\t\t- Fetches the remote repo and sets it up.');
@@ -45,7 +45,7 @@ function usage() {
log.usage('\tapp gitreset <appname> \t\t\t- Resets the app to git HEAD (in case you want a clean restart).');
log.usage('\tapp clone <appname> \t\t\t- Fetches the remote repo.');
log.usage('\tapp list \t\t\t\t- Returns the list of your apps');
- log.usage('')
+ log.usage('');
log.info('ok!'.green.bold);
}
View
2 lib/apps.js
@@ -18,7 +18,7 @@ function usage () {
log.info('`nodester apps`'.bold + ' Shortcut to `nodester app list`');
log.usage('');
log.usage('\tapps list \t- list all your registered apps (shortcut for `' + config.brand + ' app list`)');
- log.usage('')
+ log.usage('');
log.info('ok!'.green.bold);
}
View
22 lib/log.js
@@ -5,7 +5,25 @@
require('colors');
-var level = process.env.NODESTER_LOGLEVEL || 0;
+var util = require('util')
+ , level = process.env.NODESTER_LOGLEVEL || 0
+ ;
+
+// https://github.com/joyent/node/blob/master/lib/util.js#L533
+// #lazyweb
+
+function extend (origin, add) {
+ if (!add || typeof add !== 'object') return origin;
+
+ var keys = Object.keys(add);
+ var i = keys.length;
+ while (i--) {
+ origin[keys[i]] = add[keys[i]];
+ }
+ return origin;
+}
+
+util._extend = util._extend || extend;
var strArgs = function (args) {
if (args.length > 1) {
@@ -38,7 +56,7 @@ if (INTEST) {
}
};
} else {
- log.__proto__ = console;
+ util._extend(log, console);
}
exports.__defineGetter__('inTest', function() {
View
6 lib/npm.js
@@ -21,15 +21,15 @@ function usage () {
log.info('');
log.info('`nodester npm <command>`'.bold + ' manage npm packages for your apps');
log.info(' In a configured app dir, <appname> is optional.');
- log.info(' Available commands are:')
+ log.info(' Available commands are:');
log.usage('');
log.usage('All arguments after install|update|uninstall or appname will be sent to npm as packages.');
log.usage('');
log.usage('\tnpm list \t\t\t\t- Lists the installed npm packages for this app.');
log.usage('\tnpm install <appname> <packages> \t- Installs the list of specified packages to this app.');
log.usage('\tnpm update <appname> <packages> \t- Update the list of specified packages to this app.');
log.usage('\tnpm uninstall <appname> <packages> \t- Removes the list of specified packages to this app.');
- log.usage('')
+ log.usage('');
log.info('ok!'.green);
}
@@ -252,6 +252,6 @@ var npm = {
npm.i = npm.install;
npm.l = npm.list;
npm.u = npm.update;
-npm.d = npm.uninstall
+npm.un = npm.uninstall;
module.exports = npm;

0 comments on commit 25fedaf

Please sign in to comment.