[Pkg-javascript-commits] [pdf.js] 45/119: Read jshint version from package.json

David Prévot taffit at moszumanska.debian.org
Wed May 13 21:27:40 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 25299904da20d857468af2daf8b2fd73c7ec5fc0
Author: Tim van der Meij <timvandermeij at gmail.com>
Date:   Fri Apr 3 22:12:21 2015 +0200

    Read jshint version from package.json
---
 make.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/make.js b/make.js
index ff4c151..b480cee 100644
--- a/make.js
+++ b/make.js
@@ -1459,7 +1459,15 @@ target.lint = function() {
   var jshintPath = path.normalize('./node_modules/.bin/jshint');
   if (!test('-f', jshintPath)) {
     echo('jshint is not installed -- installing...');
-    exec('npm install jshint at 2.4.x'); // TODO read version from package.json
+    // Read the jshint version to be installed from package.json.
+    try {
+      var rawConfiguration = fs.readFileSync('package.json', 'utf8');
+      var configuration = JSON.parse(rawConfiguration);
+      exec('npm install jshint@' + configuration.devDependencies.jshint);
+    } catch (e) {
+      echo('package.json does not exist -- aborting...');
+      return;
+    }
   }
   // Lint the Firefox specific *.jsm files.
   var options = '--extra-ext .jsm';

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list