[Pkg-javascript-commits] [grunt] 01/02: properly handle the case when root for tasks is not specified

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Tue Jan 2 07:01:47 UTC 2018


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

praveen pushed a commit to branch master
in repository grunt.

commit 5720350cad231c36005fb05d1fef919f77d90481
Author: Pirate Praveen <praveen at debian.org>
Date:   Tue Jan 2 12:10:36 2018 +0530

    properly handle the case when root for tasks is not specified
---
 debian/patches/adapt-gruntfile.patch   | 13 +++++--------
 debian/patches/add-root-variable.patch |  5 +++--
 debian/patches/series                  |  2 +-
 3 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/debian/patches/adapt-gruntfile.patch b/debian/patches/adapt-gruntfile.patch
index 0fc6a74..46b8acb 100644
--- a/debian/patches/adapt-gruntfile.patch
+++ b/debian/patches/adapt-gruntfile.patch
@@ -1,20 +1,17 @@
 load global tasks and disable unneeded tasks
 
-Index: grunt/Gruntfile.js
-===================================================================
---- grunt.orig/Gruntfile.js
-+++ grunt/Gruntfile.js
-@@ -50,17 +50,17 @@ module.exports = function(grunt) {
+--- a/Gruntfile.js
++++ b/Gruntfile.js
+@@ -50,17 +50,17 @@
    });
  
    // These plugins provide necessary tasks.
 -  grunt.loadNpmTasks('grunt-contrib-jshint');
 -  grunt.loadNpmTasks('grunt-jscs');
--  grunt.loadNpmTasks('grunt-contrib-nodeunit');
--  grunt.loadNpmTasks('grunt-contrib-watch');
 +  //grunt.loadNpmTasks('grunt-contrib-jshint');
 +  //grunt.loadNpmTasks('grunt-jscs');
-+  grunt.loadNpmTasks('grunt-contrib-nodeunit','/usr/lib/nodejs');
+   grunt.loadNpmTasks('grunt-contrib-nodeunit');
+-  grunt.loadNpmTasks('grunt-contrib-watch');
 +  //grunt.loadNpmTasks('grunt-contrib-watch');
  
    // Some internal tasks. Maybe someday these will be released.
diff --git a/debian/patches/add-root-variable.patch b/debian/patches/add-root-variable.patch
index 98f1d87..140b754 100644
--- a/debian/patches/add-root-variable.patch
+++ b/debian/patches/add-root-variable.patch
@@ -19,7 +19,7 @@ with patch from Harish to load modules from /usr/lib/nodejs by default
  
  // Extend generic "task" util lib.
  var parent = grunt.util.task.create();
-@@ -370,9 +371,9 @@
+@@ -370,9 +371,10 @@
  
  // Load tasks and handlers from a given locally-installed Npm module (installed
  // relative to the base dir).
@@ -27,7 +27,8 @@ with patch from Harish to load modules from /usr/lib/nodejs by default
 +task.loadNpmTasks = function(name, root) {
    loadTasksMessage('"' + name + '" local Npm module');
 -  var root = path.resolve('node_modules');
-+  root = root || [ 'node_modules', '/usr/lib/nodejs'].map( v=> path.resolve(v) ).find(fs.existsSync);
++  root =  [ root, 'node_modules', '/usr/lib/nodejs'].find( v => v && fs.existsSync( path.join(v, name) ) );
++  root = root || '/usr/lib/nodejs';
    var pkgfile = path.join(root, name, 'package.json');
    var pkg = grunt.file.exists(pkgfile) ? grunt.file.readJSON(pkgfile) : {keywords: []};
  
diff --git a/debian/patches/series b/debian/patches/series
index 820d86f..fcd76bd 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,3 @@
 add-root-variable.patch
-adapt-gruntfile.patch
 reproducible-build.patch
+adapt-gruntfile.patch

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



More information about the Pkg-javascript-commits mailing list