Skip to content

Commit

Permalink
Verify that dependencies are installed
Browse files Browse the repository at this point in the history
Continues the work on #116.
  • Loading branch information
sondr3 committed Mar 29, 2016
1 parent 3c6bc46 commit 2db01ce
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var _ = require('lodash');
var chalk = require('chalk');
var generators = require('yeoman-generator');
var yosay = require('yosay');
var shelljs = require('shelljs');

module.exports = generators.Base.extend({
constructor: function () {
Expand All @@ -13,6 +14,16 @@ module.exports = generators.Base.extend({
desc: 'Skip installing dependencies',
type: Boolean
});

var dependencies = ['ruby', 'bundle', 'yo', 'gulp', 'node'].every(function (depend) {
return shelljs.which(depend);
});

if (!dependencies) {
this.log(chalk.red('You are missing one or more dependencies!'));
this.log(chalk.yellow('Make sure you have the required dependencies, or that they are in $PATH'));
shelljs.exit(1);
}
},

initializing: function () {
Expand Down

0 comments on commit 2db01ce

Please sign in to comment.