Skip to content

Commit

Permalink
Merge pull request #157 from carrot/updates
Browse files Browse the repository at this point in the history
More npm i optimizations
  • Loading branch information
kylemac committed May 16, 2016
2 parents 9ca25da + 8caa571 commit 8ec51c1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,10 @@ function createTargetDirectory (target) {
}

function installDependenciesIfPresent () {
if (!fs.existsSync(path.join(this.path, 'package.json'))) { return }
const pkgPath = path.join(this.path, 'package.json')
if (!fs.existsSync(pkgPath)) { return }
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'))
if (!pkg.dependencies) { return }
this.sprout.emit('msg', 'installing npm dependencies')
return exec('npm install --production', { cwd: this.path })
}
Expand Down

0 comments on commit 8ec51c1

Please sign in to comment.