cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject git commit: Add some color to coho
Date Fri, 25 Apr 2014 19:01:49 GMT
Repository: cordova-coho
Updated Branches:
  refs/heads/master 27c706601 -> 5123c1e09


Add some color to coho


Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/5123c1e0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/5123c1e0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/5123c1e0

Branch: refs/heads/master
Commit: 5123c1e093ded436807f790675afdd22e6485a0b
Parents: 27c7066
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Fri Apr 25 15:01:18 2014 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Fri Apr 25 15:01:45 2014 -0400

----------------------------------------------------------------------
 package.json                 | 3 ++-
 src/apputil.js               | 9 ++++++---
 src/audit-license-headers.js | 5 +++--
 src/main.js                  | 2 ++
 4 files changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/5123c1e0/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index fe09b77..1f23ad7 100644
--- a/package.json
+++ b/package.json
@@ -11,7 +11,8 @@
     "optimist": "0.4",
     "q": "~0.9",
     "request": "2.22.0",
-    "shelljs": "0.1.4"
+    "shelljs": "0.1.4",
+    "chalk": "^0.4.0"
   },
   "repository": {
     "type": "git",

http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/5123c1e0/src/apputil.js
----------------------------------------------------------------------
diff --git a/src/apputil.js b/src/apputil.js
index c172abb..2f72890 100644
--- a/src/apputil.js
+++ b/src/apputil.js
@@ -18,6 +18,7 @@ under the License.
 */
 
 var path = require('path');
+var chalk = require('chalk');
 
 var origWorkingDir = process.cwd();
 
@@ -41,11 +42,13 @@ exports.print = function() {
     // Prefix any prints() to distinguish them from command output.
     if (newArgs.length > 1 || newArgs[0]) {
         var curDir = path.relative(origWorkingDir, process.cwd());
-        var prefix = curDir ? curDir + '/ =' : './ =';
+        curDir = curDir ? curDir + '/' : './';
+        var banner = ' =';
         var PREFIX_LEN = 30;
-        if (prefix.length < PREFIX_LEN) {
-            prefix += new Array(PREFIX_LEN - prefix.length + 1).join('=');
+        if (curDir.length < PREFIX_LEN) {
+            banner += new Array(PREFIX_LEN - curDir.length + 1).join('=');
         }
+        var prefix = chalk.magenta.bold(curDir) + chalk.yellow(banner);
         newArgs.unshift(prefix);
         newArgs = newArgs.map(function(val) { return val.replace(/\n/g, '\n' + prefix + '
') });
     }

http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/5123c1e0/src/audit-license-headers.js
----------------------------------------------------------------------
diff --git a/src/audit-license-headers.js b/src/audit-license-headers.js
index 0ed986d..b431457 100644
--- a/src/audit-license-headers.js
+++ b/src/audit-license-headers.js
@@ -19,6 +19,7 @@ under the License.
 
 var fs = require('fs');
 var path = require('path');
+var chalk = require('chalk');
 var shelljs = require('shelljs');
 var optimist = require('optimist');
 var apputil = require('./apputil');
@@ -72,8 +73,8 @@ module.exports = function*() {
             apputil.fatal('Download failed.');
         }
     }
-    console.log('\x1B[31mNote: ignore filters exist and often need updating within coho.\x1B[39m');
-    console.log('\x1B[31mLook at audit-license-headers.js (COMMON_RAT_EXCLUDES) as well as
repo.ratExcludes property\x1B[39m');
+    console.log(chalk.red('Note: ignore filters exist and often need updating within coho.'));
+    console.log(chalk.red('Look at audit-license-headers.js (COMMON_RAT_EXCLUDES) as well
as repo.ratExcludes property'));
     yield repoutil.forEachRepo(repos, function*(repo) {
         var allExcludes = COMMON_RAT_EXCLUDES;
         if (repo.ratExcludes) {

http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/5123c1e0/src/main.js
----------------------------------------------------------------------
diff --git a/src/main.js b/src/main.js
index 58d4ffa..e38f509 100644
--- a/src/main.js
+++ b/src/main.js
@@ -21,6 +21,8 @@ var path = require('path');
 try {
     var co = require('co');
     var optimist = require('optimist');
+    // Ensure npm install has been run.
+    Object.keys(require('../package').dependencies).forEach(require);
 } catch (e) {
     console.log('Please run "npm install" from this directory:\n\t' + __dirname);
     process.exit(2);


Mime
View raw message