Skip to content

Commit

Permalink
Merge pull request #5 from ostrojs/develop
Browse files Browse the repository at this point in the history
Develop to master
  • Loading branch information
amarksingh authored Dec 20, 2021
2 parents 75d6b06 + c560e9a commit 92e7273
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions console/kernel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,20 @@ const fs = require('fs-extra')
const path = require('path')
const KernelContract = require('@ostro/contracts/console/kernel')
const Assistant = require('@ostro/console/application')
const kCommandLoaded = Symbol('commandsLoaded')

class Kernel extends KernelContract {
get $commandsLoaded() {
return this[kCommandLoaded] = this[kCommandLoaded] || false
}

set $commandsLoaded(value) {
return this[kCommandLoaded] = value
}
$commandsLoaded = false;

get bootstrappers() {
return [
bootstrappers = [
'@ostro/foundation/bootstrap/loadEnvironmentVariables',
'@ostro/foundation/bootstrap/loadConfiguration',
'@ostro/foundation/bootstrap/registerFacades',
'@ostro/foundation/bootstrap/registerProviders',
'@ostro/foundation/bootstrap/bootProviders',
];
}
];

get $commands() {
return {}
}
$commands = {};

constructor() {
super()
Expand All @@ -44,6 +35,13 @@ class Kernel extends KernelContract {
}
}

callCommand($command, $parameters = [], $outputBuffer = null) {

this.bootstrap();

return this.getAssistant().call($command, $parameters, $outputBuffer);
}

getAssistant() {
if (!this.assistant) {
return this.assistant = (new Assistant(this.$app, this.$app.version()))
Expand Down

0 comments on commit 92e7273

Please sign in to comment.