diff --git a/README.md b/README.md index a169881..c2d0b1f 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ $ csdx COMMAND running command... $ csdx (--version|-v) @contentstack/apps-cli/1.2.0 darwin-arm64 node-v18.20.2 +@contentstack/apps-cli/1.2.0 darwin-arm64 node-v18.20.2 $ csdx --help [COMMAND] USAGE $ csdx COMMAND @@ -129,11 +130,12 @@ Deploy an app ``` USAGE - $ csdx app:deploy [--app-uid ] [--hosting-type ] [--app-url ] [--launch-project + $ 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 diff --git a/src/commands/app/deploy.ts b/src/commands/app/deploy.ts index 1c04b32..0916952 100644 --- a/src/commands/app/deploy.ts +++ b/src/commands/app/deploy.ts @@ -63,6 +63,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); @@ -93,15 +94,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, { @@ -112,7 +115,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); } }