Skip to content

Commit f327429

Browse files
authored
Merge pull request #258 from contentstack/fix/app-uid-issue
fix: app uid issue
2 parents b9cf987 + 5c9d2ca commit f327429

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ $ csdx COMMAND
2121
running command...
2222
$ csdx (--version|-v)
2323
@contentstack/apps-cli/1.2.0 darwin-arm64 node-v18.20.2
24+
@contentstack/apps-cli/1.2.0 darwin-arm64 node-v18.20.2
2425
$ csdx --help [COMMAND]
2526
USAGE
2627
$ csdx COMMAND
@@ -129,11 +130,12 @@ Deploy an app
129130

130131
```
131132
USAGE
132-
$ csdx app:deploy [--app-uid <value>] [--hosting-type <value>] [--app-url <value>] [--launch-project
133+
$ csdx app:deploy [--app-uid <value>] [--hosting-type <value>] [--app-url <value>] [-y] [--launch-project
133134
existing|new] [-c <value>]
134135
135136
FLAGS
136137
-c, --config=<value> [optional] path of config file
138+
-y, --yes Force disconnect launch project by skipping the confirmation
137139
--app-uid=<value> Provide the app UID of an existing app.
138140
--app-url=<value> App URL
139141
--hosting-type=<value> Hosting Type

src/commands/app/deploy.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export default class Deploy extends AppCLIBaseCommand {
6363
flags["app-uid"] = this.manifestData?.uid ?? flags["app-uid"];
6464
this.sharedConfig.org = await this.getOrganization();
6565
const app = await this.fetchAppDetails();
66+
this.flags["app-uid"] = app?.uid || "";
6667

6768
const apolloClient = await this.getApolloClient();
6869
const projects = await getProjects(apolloClient);
@@ -93,15 +94,17 @@ export default class Deploy extends AppCLIBaseCommand {
9394
return;
9495
}
9596

96-
await updateApp(
97-
flags,
98-
this.sharedConfig.org,
99-
{
100-
managementSdk: this.managementAppSdk,
101-
log: this.log,
102-
},
103-
updateHostingPayload
104-
);
97+
if(this.flags["app-uid"]){
98+
await updateApp(
99+
flags,
100+
this.sharedConfig.org,
101+
{
102+
managementSdk: this.managementAppSdk,
103+
log: this.log,
104+
},
105+
updateHostingPayload
106+
);
107+
}
105108

106109
this.log(
107110
this.$t(deployAppMsg.APP_DEPLOYED, {
@@ -112,7 +115,7 @@ export default class Deploy extends AppCLIBaseCommand {
112115
this.log(`App URL: ${flags["app-url"]}`, "info");
113116
} catch (error: any) {
114117
this.log(error?.errorMessage || error?.message || error, "error");
115-
this.exit(1);
118+
process.exit(1);
116119
}
117120
}
118121

src/commands/app/reinstall.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export default class Reinstall extends AppCLIBaseCommand {
120120
this.displayStackUrl();
121121
} catch (error: any) {
122122
this.log(error?.errorMessage || error?.message || error, "error");
123-
this.exit(1);
123+
process.exit(1);
124124
}
125125
}
126126

0 commit comments

Comments
 (0)