Skip to content

Commit

Permalink
Check for pre-existing plugin before generation
Browse files Browse the repository at this point in the history
  • Loading branch information
CamdenSegal committed Aug 1, 2015
1 parent efc7688 commit df8d439
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ module.exports = base.extend({
writing: {
folder: function() {
this.destinationRoot( this.slug );

var done = this.async();
fs.lstat( this.destinationPath(), function(err, stats) {
if (!err && stats.isDirectory()) {
this.log( chalk.red( 'A plugin already exists with this folder name, exiting...' ) );
process.exit();
}
done();
}.bind(this));
},

dotfiles: function() {
Expand Down Expand Up @@ -253,6 +262,8 @@ module.exports = base.extend({
skipInstall: this.options['skip-install']
});



if ( this.autoloader === 'Composer' && !this.options['skip-install'] ) {
this.spawnCommand('composer', ['install']);
}
Expand Down

0 comments on commit df8d439

Please sign in to comment.