From 4cd7cc6c49fc4fa73a7e41dbc1b9ec5a5bedad7f Mon Sep 17 00:00:00 2001 From: Aman Kumar Date: Wed, 19 Jun 2024 18:38:39 +0530 Subject: [PATCH 1/3] fix: app uid issue --- src/commands/app/deploy.ts | 3 ++- src/commands/app/reinstall.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/app/deploy.ts b/src/commands/app/deploy.ts index adb7a1e..d437a2b 100644 --- a/src/commands/app/deploy.ts +++ b/src/commands/app/deploy.ts @@ -68,6 +68,7 @@ export default class Deploy extends AppCLIBaseCommand { flags["app-uid"] = this.manifestData?.uid ?? flags["app-uid"]; this.sharedConfig.org = await this.getOrganization(); const app = await this.fetchAppDetails(); + this.flags["app-uid"] = app?.uid; const apolloClient = await this.getApolloClient(); const projects = await getProjects(apolloClient); @@ -117,7 +118,7 @@ export default class Deploy extends AppCLIBaseCommand { this.log(`App URL: ${flags["app-url"]}`, "info"); } catch (error: any) { this.log(error?.errorMessage || error?.message || error, "error"); - this.exit(1); + process.exit(1); } } diff --git a/src/commands/app/reinstall.ts b/src/commands/app/reinstall.ts index 71c15ad..d1305b3 100644 --- a/src/commands/app/reinstall.ts +++ b/src/commands/app/reinstall.ts @@ -120,7 +120,7 @@ export default class Reinstall extends AppCLIBaseCommand { this.displayStackUrl(); } catch (error: any) { this.log(error?.errorMessage || error?.message || error, "error"); - this.exit(1); + process.exit(1); } } From 99f75d8f2e35cba85df8496863c387b3730b8c32 Mon Sep 17 00:00:00 2001 From: Aman Kumar Date: Wed, 19 Jun 2024 18:40:25 +0530 Subject: [PATCH 2/3] added check for app-uid --- src/commands/app/deploy.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/commands/app/deploy.ts b/src/commands/app/deploy.ts index d437a2b..11ae089 100644 --- a/src/commands/app/deploy.ts +++ b/src/commands/app/deploy.ts @@ -68,7 +68,7 @@ export default class Deploy extends AppCLIBaseCommand { flags["app-uid"] = this.manifestData?.uid ?? flags["app-uid"]; this.sharedConfig.org = await this.getOrganization(); const app = await this.fetchAppDetails(); - this.flags["app-uid"] = app?.uid; + this.flags["app-uid"] = app?.uid || ""; const apolloClient = await this.getApolloClient(); const projects = await getProjects(apolloClient); @@ -99,15 +99,17 @@ export default class Deploy extends AppCLIBaseCommand { return; } - await updateApp( - flags, - this.sharedConfig.org, - { - managementSdk: this.managementAppSdk, - log: this.log, - }, - updateHostingPayload - ); + if(this.flags["app-uid"]){ + await updateApp( + flags, + this.sharedConfig.org, + { + managementSdk: this.managementAppSdk, + log: this.log, + }, + updateHostingPayload + ); + } this.log( this.$t(deployAppMsg.APP_DEPLOYED, { From e008e13706871d035d5463c15391e276f8b8f2f9 Mon Sep 17 00:00:00 2001 From: Aman Kumar Date: Wed, 19 Jun 2024 18:41:52 +0530 Subject: [PATCH 3/3] updated reademe file --- README.md | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 2c675e8..502ade9 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.1.1 darwin-arm64 node-v18.20.2 +@contentstack/apps-cli/1.2.0 darwin-arm64 node-v18.20.2 $ csdx --help [COMMAND] USAGE $ csdx COMMAND @@ -67,7 +67,7 @@ EXAMPLES $ csdx app:reinstall ``` -_See code: [src/commands/app/index.ts](https://github.com/contentstack/apps-cli/blob/v1.1.1/src/commands/app/index.ts)_ +_See code: [src/commands/app/index.ts](https://github.com/contentstack/apps-cli/blob/v1.2.0/src/commands/app/index.ts)_ ## `csdx app:create` @@ -97,7 +97,7 @@ EXAMPLES $ csdx app:create --name App-3 --app-type organization --org -d ./boilerplate -c ./external-config.json ``` -_See code: [src/commands/app/create.ts](https://github.com/contentstack/apps-cli/blob/v1.1.1/src/commands/app/create.ts)_ +_See code: [src/commands/app/create.ts](https://github.com/contentstack/apps-cli/blob/v1.2.0/src/commands/app/create.ts)_ ## `csdx app:delete` @@ -121,7 +121,7 @@ EXAMPLES $ csdx app:delete --app-uid --org -d ./boilerplate ``` -_See code: [src/commands/app/delete.ts](https://github.com/contentstack/apps-cli/blob/v1.1.1/src/commands/app/delete.ts)_ +_See code: [src/commands/app/delete.ts](https://github.com/contentstack/apps-cli/blob/v1.2.0/src/commands/app/delete.ts)_ ## `csdx app:deploy` @@ -129,17 +129,17 @@ Deploy an app ``` USAGE - $ csdx app:deploy [--app-uid ] [--hosting-type ] [--app-url ] [-y] [--launch-project-type - existing-project|new-project] [-c ] + $ csdx app:deploy [--app-uid ] [--hosting-type ] [--app-url ] [-y] [--launch-project + existing|new] [-c ] FLAGS - -c, --config= [optional] path of config file - -y, --yes Force disconnect launch project by skipping the confirmation - --app-uid= Provide the app UID of an existing app. - --app-url= App URL - --hosting-type= Hosting Type - --launch-project-type=