Skip to content

Commit

Permalink
Merge pull request #613 from attomos/master
Browse files Browse the repository at this point in the history
Added GeneratorUtilities.prototype.isBaseDirExists function.
  • Loading branch information
1602 committed Mar 4, 2014
2 parents 831d5ea + f31d44e commit 5c3b77c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/server/generators/app_generator.js
Expand Up @@ -47,7 +47,9 @@ AppGenerator.prototype.perform = function (args) {
if (this.options.appName) {
this.baseDir = path.join(this.baseDir, this.options.appName);
}

if (this.isBaseDirExists()) {
return;
}
this.createDirectoryStructure();
this.copyFiles();
};
Expand Down
10 changes: 9 additions & 1 deletion lib/server/generators/generator_utils.js
Expand Up @@ -425,7 +425,7 @@ GeneratorUtilities.prototype.getDatabaseDependency = function() {
}
};

GeneratorUtilities.prototype.isEvalAllowed = function () {
GeneratorUtilities.prototype.isEvalAllowed = function() {
return !('noeval' in this.options);
};

Expand All @@ -436,4 +436,12 @@ GeneratorUtilities.prototype.generateSecret = function() {
.digest('hex');
};

GeneratorUtilities.prototype.isBaseDirExists = function() {
var exists = fs.existsSync(this.baseDir);
if (exists) {
this.log($('"' + this.baseDir + '" exists', this.baseDir).bold.red);
}
return exists;
};

module.exports = GeneratorUtilities;

0 comments on commit 5c3b77c

Please sign in to comment.