Permalink
Browse files

Merge pull request #57 from RobinThrift/master

CLI now tries to require local modules first
  • Loading branch information...
2 parents 44581c5 + f4050a7 commit dc4002abbb69be260f8dbe09bd944c25708a2502 @ianstormtaylor ianstormtaylor committed May 19, 2014
Showing with 6 additions and 1 deletion.
  1. +6 −1 bin/metalsmith
View
@@ -47,9 +47,14 @@ plugins.forEach(function(plugin){
for (var name in plugin) {
var opts = plugin[name];
var fn;
+ var localPath = resolve(process.cwd(), 'node_modules', name);
try {
- fn = require(name);
+ if (exists(localPath)) {
+ fn = require(localPath);
+ } else {
+ fn = require(name);
+ }
} catch (e) {
fatal('failed to require plugin "' + name + '".');
}

0 comments on commit dc4002a

Please sign in to comment.