diff --git a/bin/common/executor/models.js b/bin/common/executor/models.js index f1ad0f1..7839082 100644 --- a/bin/common/executor/models.js +++ b/bin/common/executor/models.js @@ -101,39 +101,9 @@ export class ExecutionInterface { * @param runtime {Runtime} */ async handle(execute, runtime) { - if (runtime.times != null) { - await this.#run(execute, runtime); - return; - } - await this._execute(execute, runtime); } - /** - * Run command multiple times - * @param execute {Execute} - * @param runtime {Runtime} - * @returns {Promise} - */ - async #run(execute, runtime) { - let count = 1; - let completed = false; - - while (!completed) { - await this._execute(execute, runtime); - - if (runtime.times !== 0 && count === runtime.times) { - completed = true; - } else { - await new Promise(resolve => setTimeout(resolve, runtime.interval)); - } - - if (runtime.times > 0) { - count++; - } - } - } - /** * @return {Promise} */ diff --git a/bin/common/models/common.js b/bin/common/models/common.js index 883d5f6..c4bb5cc 100644 --- a/bin/common/models/common.js +++ b/bin/common/models/common.js @@ -11,12 +11,6 @@ export class Args { */ down; - /** - * Option for running environment - * @type {string} - */ - run; - /** * Starts one or more groups of executions * @type {boolean|string|string[]} @@ -29,18 +23,6 @@ export class Args { */ downGroup; - /** - * Number of times to run - * @type {number|null} - */ - times; - - /** - * Interval between each run - * @type {number|null} - */ - interval; - /** * Option (optional) included with start for starting environment cleanly * @type {boolean} diff --git a/bin/execution/executor/executor-yargs-generator.js b/bin/execution/executor/executor-yargs-generator.js index 503238e..cefb141 100644 --- a/bin/execution/executor/executor-yargs-generator.js +++ b/bin/execution/executor/executor-yargs-generator.js @@ -93,7 +93,8 @@ export default new class { yargs .positional('name', { describe: 'Name of the action', - type: 'string' + type: 'string', + demandOption: true }) .option('times', { alias: 't', @@ -111,6 +112,7 @@ export default new class { customOptionsYargsCreator.addToYargs(yargs, segment.actions) }, handler: (argv) => { + // TODO: Implement this.#execute(segment, project, argv).catch(console.error); } }) diff --git a/bin/execution/executor/runtime-mapper.js b/bin/execution/executor/runtime-mapper.js index 4bb4f76..6dfa84e 100644 --- a/bin/execution/executor/runtime-mapper.js +++ b/bin/execution/executor/runtime-mapper.js @@ -5,7 +5,7 @@ export default new class { * @returns {Runtime} */ getRuntime(args) { - const up = this.#hasValue(args, 'up') || this.#hasValue(args, 'run'); + const up = this.#hasValue(args, 'up'); const down = this.#hasValue(args, 'down'); const upGroup = this.#hasValue(args, 'up-group'); const downGroup = this.#hasValue(args, 'down-group'); @@ -20,8 +20,6 @@ export default new class { return { up: up || upGroup, down: down || downGroup, - times: args.times, - interval: args.interval, include: { executions: up || down ? this.#getVariables(args['name']) : [], groups: upGroup || downGroup ? this.#getVariables(args[`name`]) : [] @@ -66,18 +64,6 @@ export class Runtime { */ down; - /** - * Times to run the actions - * @type {number | null} - */ - times; - - /** - * Interval between each run - * @type {number | null} - */ - interval; - /** * List of groups and executions to be included in starting or stopping * @type { { executions: string[], groups: string[] } | null }