Add support for running routines via command line

This commit is contained in:
garrettmills
2020-08-13 20:28:23 -05:00
parent afb35ebad8
commit f5b84b530c
33 changed files with 396 additions and 5 deletions

View File

@@ -25,6 +25,7 @@ class StatesService extends Service {
'git.clone': require('../classes/state/git/CloneState'),
'git.checkout': require('../classes/state/git/CheckoutState'),
'git.tag': require('../classes/state/git/TagState'),
'git.pull': require('../classes/state/git/PullState'),
'os.cmd': require('../classes/state/os/CommandState'),
'os.alive': require('../classes/state/os/IsAliveState'),
@@ -57,7 +58,7 @@ class StatesService extends Service {
const StepClass = this.constructor.#state_map[type]
if ( !StepClass ) throw new Error(`Invalid or unknown step type: ${type}`)
this.app.make(StepClass)
this.app.di().inject(StepClass)
return new StepClass(host, state_config)
}