From fb2d7c2f8b39c84ae126384df781d870c155f4d5 Mon Sep 17 00:00:00 2001 From: Jeff Lu Date: Wed, 19 Jan 2022 20:26:27 -0500 Subject: [PATCH] up version --- package.json | 2 +- src/commands/deploy.ts | 122 +++++++++++++++++++++-------------------- 2 files changed, 63 insertions(+), 61 deletions(-) diff --git a/package.json b/package.json index 5c5dc52..31c3ceb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hzn-cli", - "version": "0.2.2", + "version": "0.2.3", "description": "Open Horizon CLI toolkit helps streamline the process of preparing node agents and perform tasks between orgs environments", "main": "./build/index.js", "bin": { diff --git a/src/commands/deploy.ts b/src/commands/deploy.ts index ffc0a56..10c9177 100644 --- a/src/commands/deploy.ts +++ b/src/commands/deploy.ts @@ -92,68 +92,70 @@ export const handler = (argv: Arguments): void => { if(action) { console.log('$$$ ', action, env); - utils.checkDefaultConfig() - .subscribe({ - complete: () => { - if(runDirectly.indexOf(action) >= 0) { - utils[action]() - .subscribe({ - complete: () => process.exit(0), - error: (err) => { - console.log(err); - process.exit(0); - } - }) - } else if(skipInitialize.indexOf(action) >= 0) { - proceed(); - } else if(justRun.indexOf(action) >= 0) { - utils.orgCheck(env, true) - .subscribe({ - complete: () => proceed(), - error: (err) => { - console.log(err); - process.exit(0); - } - }) - } else if(promptForUpdate.indexOf(action) < 0 || skip_config_update) { - utils.orgCheck(env, skip_config_update === 'true') - .subscribe({ - complete: () => proceed(), - error: (err) => { - console.log(err); - process.exit(0); - } - }) - } else { - utils.updateEnvFiles(env) - .subscribe({ - complete: () => { - proceed() - }, error: (err) => { - console.log(err) - process.exit(0); - } - }) + if(runDirectly.indexOf(action) >= 0) { + utils[action]() + .subscribe({ + complete: () => process.exit(0), + error: (err) => { + console.log(err); + process.exit(0); } - }, error: (err) => { - if(skipInitialize.indexOf(action) < 0) { - console.log(err, 'Initialising...') - utils.setupEnvFiles(env) - .subscribe({ - complete: () => { - proceed(); - }, error: () => process.exit(0) - }) - } else { - utils.uninstallHorizon() - .subscribe({ - complete:() => { - console.log('process completed.'); - process.exit(0) - } - }) + }) + } else { + utils.checkDefaultConfig() + .subscribe({ + complete: () => { + if(skipInitialize.indexOf(action) >= 0) { + proceed(); + } else if(justRun.indexOf(action) >= 0) { + utils.orgCheck(env, true) + .subscribe({ + complete: () => proceed(), + error: (err) => { + console.log(err); + process.exit(0); + } + }) + } else if(promptForUpdate.indexOf(action) < 0 || skip_config_update) { + utils.orgCheck(env, skip_config_update === 'true') + .subscribe({ + complete: () => proceed(), + error: (err) => { + console.log(err); + process.exit(0); + } + }) + } else { + utils.updateEnvFiles(env) + .subscribe({ + complete: () => { + proceed() + }, error: (err) => { + console.log(err) + process.exit(0); + } + }) + } + }, error: (err) => { + if(skipInitialize.indexOf(action) < 0) { + console.log(err, 'Initialising...') + utils.setupEnvFiles(env) + .subscribe({ + complete: () => { + proceed(); + }, error: () => process.exit(0) + }) + } else { + utils.uninstallHorizon() + .subscribe({ + complete:() => { + console.log('process completed.'); + process.exit(0) + } + }) + } } - } + } }) } else { console.log('specify an action you would like to perform, ex: "oh deploy test" or "oh deploy -h" for help')