From d7432ff9e01d2dd1b64623622d8e4924f2bef209 Mon Sep 17 00:00:00 2001 From: Harshitha D Date: Mon, 26 Aug 2024 12:31:00 +0530 Subject: [PATCH] fixed receiving eexit after encountering error --- README.md | 2 +- package-lock.json | 6 +++--- src/commands/app/install.ts | 3 ++- src/commands/app/reinstall.ts | 8 ++++++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 65c6ece..db39339 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ $ npm install -g @contentstack/apps-cli $ csdx COMMAND running command... $ csdx (--version|-v) -@contentstack/apps-cli/1.3.3 darwin-arm64 node-v18.12.1 +@contentstack/apps-cli/1.3.3 darwin-x64 node-v20.16.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/package-lock.json b/package-lock.json index b728ed6..b3adba7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,9 +10,9 @@ "license": "MIT", "dependencies": { "@apollo/client": "^3.7.9", - "@contentstack/cli-command": "^1.2.19", - "@contentstack/cli-launch": "^1.2.0", - "@contentstack/cli-utilities": "^1.7.0", + "@contentstack/cli-command": "~1.2.19", + "@contentstack/cli-launch": "~1.2.0", + "@contentstack/cli-utilities": "~1.7.0", "adm-zip": "^0.5.15", "chalk": "^4.1.2", "lodash": "^4.17.21", diff --git a/src/commands/app/install.ts b/src/commands/app/install.ts index ae2d4fc..c1bf83f 100644 --- a/src/commands/app/install.ts +++ b/src/commands/app/install.ts @@ -128,8 +128,9 @@ export default class Install extends AppCLIBaseCommand { error?.status === 400 ) { this.displayReInstallMsg(); + } else { + this.exit(1); } - this.exit(1); } } diff --git a/src/commands/app/reinstall.ts b/src/commands/app/reinstall.ts index f75d812..a930972 100644 --- a/src/commands/app/reinstall.ts +++ b/src/commands/app/reinstall.ts @@ -117,8 +117,12 @@ export default class Reinstall extends AppCLIBaseCommand { this.displayStackUrl(); } catch (error: any) { - this.log(error?.errorMessage || error?.message || error, "error"); - this.exit(1); + if (error?.errorMessage !== "You are already using the latest version.") { + this.log(error?.errorMessage || error?.message || error, "error"); + this.exit(1); + } else { + this.log(error?.errorMessage || error?.message || error, "error"); + } } }