Skip to content

Commit

Permalink
#182: fix npm 2
Browse files Browse the repository at this point in the history
  • Loading branch information
robhrt7 committed Sep 20, 2015
1 parent 206c23d commit 0c98b50
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
'use strict';
var path = require('path');
var fs = require('fs');

var pathToApp = path.resolve('./');
var parentFolderName = path.basename(path.resolve('..'));
global.pathToApp = pathToApp;

var loadOptions = require('./core/loadOptions');

// NPM 3 compatibility fix
var getLoaderPackageName = function() {
var packageName;
var parentFolderName = path.basename(path.resolve('..'));
var isSubPackage = parentFolderName === 'node_modules';
if (isSubPackage) {
var isLocalDepsAvailable = fs.existsSync('node_modules/grunt-autoprefixer') && fs.existsSync('node_modules/grunt-contrib-cssmin');

if (isSubPackage && !isLocalDepsAvailable) {
packageName = 'load-grunt-parent-tasks';
} else {
packageName = 'load-grunt-tasks';
}

return packageName;
};

Expand Down

0 comments on commit 0c98b50

Please sign in to comment.