Skip to content

Commit

Permalink
fix create command
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Sep 20, 2017
1 parent 51df633 commit e73b0b8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions lib/create/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ command.command('app', '[output] [name]')
},
'app'
)
.args(function(output, name){
.args(function(args){
var output = args[0];
var name = args[1];

if (output)
this.setOption('output', output);
if (name)
Expand All @@ -122,7 +125,9 @@ command.command('module', '[name]')
.option('-n, --name <name>', 'Name of module')
.option('-a, --app-name <name>', 'App root namespace')
.option('-T, --type <name>', 'Type name that should be used by module')
.args(function(name){
.args(function(args){
var name = args[0];

this.setOption('name', name);
})
.action(function(){
Expand All @@ -141,7 +146,9 @@ command.command('type', '[name]')
.option('-t, --template <name>', 'Name of template', 'default')
.option('-n, --name <name>', 'Name of type')
.option('-a, --app-name <name>', 'App root namespace')
.args(function(name){
.args(function(args){
var name = args[0];

if (!/[A-Z]/.test(name.charAt(0)))
throw new Error('Type name should begins with capital letter:', name);

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"basisjs-tools-ast": "^1.6.0",
"basisjs-tools-build": "^1.11.3",
"basisjs-tools-server": "^1.0.1",
"clap": "~1.2.2",
"clap": "~1.2.3",
"update-notifier": "0.6.3",
"chalk": "~1.1.3",
"win-spawn": "2.0.0",
Expand Down

0 comments on commit e73b0b8

Please sign in to comment.