Skip to content

Commit

Permalink
Install "patch-package" package, to patch panini to make it work with…
Browse files Browse the repository at this point in the history
… absolute paths and add patch

See: foundation/panini#169
  • Loading branch information
marvinhuebner committed Nov 9, 2018
1 parent b388d2e commit 1b4ae09
Show file tree
Hide file tree
Showing 3 changed files with 285 additions and 6 deletions.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"stylelint-config-standard": "~18.2.0"
},
"scripts": {
"prepare": "patch-package",
"babel": "gulp babel",
"clean": "gulp clean",
"csslint": "gulp csslint",
Expand All @@ -73,5 +74,9 @@
"watch": "gulp watch",
"email": "gulp email",
"test": "./node_modules/eslint/bin/eslint.js *.js helper/*.js task/*.js"
},
"devDependencies": {
"patch-package": "^5.1.1",
"postinstall-prepare": "^1.0.1"
}
}
17 changes: 17 additions & 0 deletions patches/panini+1.6.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
patch-package
--- a/node_modules/panini/lib/utils.js
+++ b/node_modules/panini/lib/utils.js
@@ -16,7 +16,12 @@ exports.loadFiles = function(dir, pattern) {
dir = !Array.isArray(dir) ? [dir] : dir;

for (var i in dir) {
- files = files.concat(glob.sync(path.join(process.cwd(), dir[i], pattern)));
+ var filePath = [process.cwd(), dir[i], pattern];
+ if(path.isAbsolute(dir[i])) {
+ filePath.shift();
+ }
+
+ files = files.concat(glob.sync(path.join.apply(null, filePath)));
}

return files;
Loading

0 comments on commit 1b4ae09

Please sign in to comment.