Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: app uid issue #258

Merged
merged 4 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -129,11 +130,12 @@ Deploy an app

```
USAGE
$ csdx app:deploy [--app-uid <value>] [--hosting-type <value>] [--app-url <value>] [--launch-project
$ csdx app:deploy [--app-uid <value>] [--hosting-type <value>] [--app-url <value>] [-y] [--launch-project
existing|new] [-c <value>]

FLAGS
-c, --config=<value> [optional] path of config file
-y, --yes Force disconnect launch project by skipping the confirmation
--app-uid=<value> Provide the app UID of an existing app.
--app-url=<value> App URL
--hosting-type=<value> Hosting Type
Expand Down
23 changes: 13 additions & 10 deletions src/commands/app/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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, {
Expand All @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/commands/app/reinstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
Loading