Skip to content

Commit

Permalink
Merge branch 'release-3.0.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Jul 11, 2017
2 parents fc2ca6d + 941f609 commit 84e9c93
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,14 @@
<a name="3.0.8"></a>
## [3.0.8](https://github.com/adonisjs/ace/compare/v3.0.7...v3.0.8) (2017-07-11)


### Bug Fixes

* **command:** use command.opts() over command._events ([da5e4e8](https://github.com/adonisjs/ace/commit/da5e4e8)), closes [#604](https://github.com/adonisjs/ace/issues/604)
* **package:** update node-exceptions to version 2.0.0 ([#49](https://github.com/adonisjs/ace/issues/49)) ([89dab62](https://github.com/adonisjs/ace/commit/89dab62))



<a name="3.0.7"></a>
## [3.0.7](https://github.com/adonisjs/ace/compare/v3.0.6...v3.0.7) (2017-02-25)

Expand Down
6 changes: 3 additions & 3 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "adonis-ace",
"version": "3.0.7",
"version": "3.0.8",
"description": "Ace is a command line tool for adonisjs framework",
"main": "index.js",
"directories": {
Expand All @@ -22,7 +22,7 @@
"cz-conventional-changelog": "^2.0.0",
"istanbul": "^0.4.5",
"mocha": "^3.2.0",
"sinon": "^1.17.6",
"sinon": "^2.0.0",
"standard": "^8.6.0"
},
"config": {
Expand All @@ -39,7 +39,7 @@
"es6-class-mixin": "^1.0.5",
"inquirer": "^3.0.2",
"lodash": "^4.17.2",
"node-exceptions": "^1.0.3"
"node-exceptions": "^2.0.0"
},
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions src/Command/index.js
Expand Up @@ -63,14 +63,14 @@ class Command {
const self = this
const args = _.toArray(arguments)
const paramsLength = this.args.length
const commandOptions = args[paramsLength]
const commandOptions = args[args.length - 1]
const params = {}
const options = {}
_.each(_.take(args, paramsLength), (value, index) => {
params[this.args[index].name] = value || null
})
_.each(commandOptions._events, (option, name) => {
options[name] = commandOptions[name] || commandOptions[_.camelCase(name)] || null
_.each(commandOptions.opts(), (option, name) => {
options[name] = commandOptions[name] || null
})
this.setup()
co(function * () {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/command.spec.js
Expand Up @@ -238,6 +238,6 @@ describe('Command', function () {
const controller = new ControllerGenerator()
controller.run('new', ['awesome-project'], {'skip-install': true})
expect(commandData.args).deep.equal({name: 'awesome-project'})
expect(commandData.options).deep.equal({'skip-install': true})
expect(commandData.options).deep.equal({skipInstall: true})
})
})

0 comments on commit 84e9c93

Please sign in to comment.