diff --git a/bin/setup.js b/bin/setup.js index 73547779a..50a8b0e12 100644 --- a/bin/setup.js +++ b/bin/setup.js @@ -4,9 +4,10 @@ var path = require('path') var fs = require('fs') var log = require('npmlog') -var installIntoApp = process.env.PWD.indexOf('node_modules') !== -1 +var isInstallIntoApp = /node_modules/.test(process.cwd()) + // This block only executes if Hoodie is installed with as a dependency -if (installIntoApp) { +if (isInstallIntoApp) { var pathToAppRoot = path.resolve('..', '..') var packageJson = require(path.join(pathToAppRoot, 'package.json'))