Skip to content

Commit

Permalink
Extra options for generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Alves committed May 31, 2016
1 parent bc6ec23 commit 594104b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bin/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@ var rename = bluebird.promisify(require('fs').rename);

ncp.limit = 16;

var newProjectDir = process.cwd();
var newProjectDir = (function () {

if (process.argv[2]) {
return path.join(process.cwd(), process.argv[2]);
}

return process.cwd();

})();

var generatorFilesPath = path.join(__dirname, '../generated');


Expand Down

3 comments on commit 594104b

@glebec
Copy link
Member

@glebec glebec commented on 594104b May 31, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also have it where if there is no argument, the new project dir is a new fsg folder within process.cwd? That would avoid my (or someone else's) accidentally creating fsg files in their current directory unexpectedly. The ideal would also be to check if an fsg folder already exists and confirm the user wants to populate it if so — the ultimate in preventing accidents. I would do it myself but I'm in an interview right now (heh).

@glebec
Copy link
Member

@glebec glebec commented on 594104b May 31, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I would use path.resolve in case someone puts in an absolute path as an argument

@glebec
Copy link
Member

@glebec glebec commented on 594104b Jun 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in #53.

Please sign in to comment.