Skip to content

Commit

Permalink
feat(installer): use safer path.join approach
Browse files Browse the repository at this point in the history
  • Loading branch information
therealklanni committed Jan 29, 2016
1 parent ee6a064 commit 7796afd
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions install.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
'use strict';

require('shelljs/global');
var path = require('path');
var gup = require('guppy-cli');
var async = require('async');
var pack = require(rootApplicationPath() + '/package.json');

if (pack['guppy-hooks']) {
async.each(pack['guppy-hooks'], function (hook, next) {
gup.install(hook, null, next);
});
function rootApplicationPath() {
return exec('git rev-parse --show-toplevel', { silent: true }).output;
}

function rootApplicationPath() {
return exec('git rev-parse --show-toplevel', { silent: true })
.output.slice(0, -1);
var pkg = require(path.join(rootApplicationPath(), 'package.json'));

if (pkg['guppy-hooks']) {
async.each(pkg['guppy-hooks'], function (hook, next) {
gup.install(hook, null, next);
});
}

0 comments on commit 7796afd

Please sign in to comment.