Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
fix(hooks): fire before and after aceCommand hooks
Browse files Browse the repository at this point in the history
fix #6
  • Loading branch information
thetutlage committed Jan 6, 2018
1 parent c559c35 commit cbc80e5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Ignitor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -689,11 +689,23 @@ class Ignitor {
process.env.NODE_ENV = 'testing'
}

this._callHooks('before', 'aceCommand')

this.loadCommands()
await this.fire()

const ace = require(path.join(this._appRoot, '/node_modules/@adonisjs/ace'))
ace.wireUpWithCommander()
const version = this._packageFile['adonis-version'] || 'NA'

/**
* Fire after `aceCommand` hook, before process goes
* down.
*/
process.once('beforeExit', () => {
this._callHooks('after', 'aceCommand')
})

ace.invoke({ version })
}
}
Expand Down

0 comments on commit cbc80e5

Please sign in to comment.