Skip to content

Commit b9cf987

Browse files
authored
Merge pull request #257 from contentstack/fix/launch-project-query
fix: launch project query, removed duplicate yes flag & updated readme
2 parents cef7d91 + 8eba9b7 commit b9cf987

File tree

3 files changed

+26
-33
lines changed

3 files changed

+26
-33
lines changed

README.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $ npm install -g @contentstack/apps-cli
2020
$ csdx COMMAND
2121
running command...
2222
$ csdx (--version|-v)
23-
@contentstack/apps-cli/1.1.1 darwin-arm64 node-v18.20.2
23+
@contentstack/apps-cli/1.2.0 darwin-arm64 node-v18.20.2
2424
$ csdx --help [COMMAND]
2525
USAGE
2626
$ csdx COMMAND
@@ -67,7 +67,7 @@ EXAMPLES
6767
$ csdx app:reinstall
6868
```
6969

70-
_See code: [src/commands/app/index.ts](https://github.com/contentstack/apps-cli/blob/v1.1.1/src/commands/app/index.ts)_
70+
_See code: [src/commands/app/index.ts](https://github.com/contentstack/apps-cli/blob/v1.2.0/src/commands/app/index.ts)_
7171

7272
## `csdx app:create`
7373

@@ -97,7 +97,7 @@ EXAMPLES
9797
$ csdx app:create --name App-3 --app-type organization --org <UID> -d ./boilerplate -c ./external-config.json
9898
```
9999

100-
_See code: [src/commands/app/create.ts](https://github.com/contentstack/apps-cli/blob/v1.1.1/src/commands/app/create.ts)_
100+
_See code: [src/commands/app/create.ts](https://github.com/contentstack/apps-cli/blob/v1.2.0/src/commands/app/create.ts)_
101101

102102
## `csdx app:delete`
103103

@@ -121,25 +121,24 @@ EXAMPLES
121121
$ csdx app:delete --app-uid <value> --org <value> -d ./boilerplate
122122
```
123123

124-
_See code: [src/commands/app/delete.ts](https://github.com/contentstack/apps-cli/blob/v1.1.1/src/commands/app/delete.ts)_
124+
_See code: [src/commands/app/delete.ts](https://github.com/contentstack/apps-cli/blob/v1.2.0/src/commands/app/delete.ts)_
125125

126126
## `csdx app:deploy`
127127

128128
Deploy an app
129129

130130
```
131131
USAGE
132-
$ csdx app:deploy [--app-uid <value>] [--hosting-type <value>] [--app-url <value>] [-y] [--launch-project-type
133-
existing-project|new-project] [-c <value>]
132+
$ csdx app:deploy [--app-uid <value>] [--hosting-type <value>] [--app-url <value>] [--launch-project
133+
existing|new] [-c <value>]
134134
135135
FLAGS
136-
-c, --config=<value> [optional] path of config file
137-
-y, --yes Force disconnect launch project by skipping the confirmation
138-
--app-uid=<value> Provide the app UID of an existing app.
139-
--app-url=<value> App URL
140-
--hosting-type=<value> Hosting Type
141-
--launch-project-type=<option> Launch Project Type
142-
<options: existing-project|new-project>
136+
-c, --config=<value> [optional] path of config file
137+
--app-uid=<value> Provide the app UID of an existing app.
138+
--app-url=<value> App URL
139+
--hosting-type=<value> Hosting Type
140+
--launch-project=<option> Launch Project
141+
<options: existing|new>
143142
144143
DESCRIPTION
145144
Deploy an app
@@ -151,12 +150,14 @@ EXAMPLES
151150
152151
$ csdx app:deploy --org <UID> --app-uid <APP-UID-1> --hosting-type <Custom Hosting> --app-url <https://localhost:3000>
153152
154-
$ csdx app:deploy --org <UID> --app-uid <APP-UID-1> --hosting-type <Hosting with Launch> --launch-project-type <existing-project>
153+
$ csdx app:deploy --org <UID> --app-uid <APP-UID-1> --hosting-type <Hosting with Launch> --launch-project <existing>
155154
156-
$ csdx app:deploy --org <UID> --app-uid <APP-UID-1> --hosting-type <Hosting with Launch> --launch-project-type <existing-project> --config <config-path>
155+
$ csdx app:deploy --org <UID> --app-uid <APP-UID-1> --hosting-type <Hosting with Launch> --launch-project <new>
156+
157+
$ csdx app:deploy --org <UID> --app-uid <APP-UID-1> --hosting-type <Hosting with Launch> --launch-project <new> --config <config-path>
157158
```
158159

159-
_See code: [src/commands/app/deploy.ts](https://github.com/contentstack/apps-cli/blob/v1.1.1/src/commands/app/deploy.ts)_
160+
_See code: [src/commands/app/deploy.ts](https://github.com/contentstack/apps-cli/blob/v1.2.0/src/commands/app/deploy.ts)_
160161

161162
## `csdx app:get`
162163

@@ -185,7 +186,7 @@ EXAMPLES
185186
$ csdx app:get --org <value> --app-uid <value> --app-type organization
186187
```
187188

188-
_See code: [src/commands/app/get.ts](https://github.com/contentstack/apps-cli/blob/v1.1.1/src/commands/app/get.ts)_
189+
_See code: [src/commands/app/get.ts](https://github.com/contentstack/apps-cli/blob/v1.2.0/src/commands/app/get.ts)_
189190

190191
## `csdx app:install`
191192

@@ -210,7 +211,7 @@ EXAMPLES
210211
$ csdx app:install --org <UID> --app-uid <APP-UID-1> --stack-api-key <STACK-API-KEY-1>
211212
```
212213

213-
_See code: [src/commands/app/install.ts](https://github.com/contentstack/apps-cli/blob/v1.1.1/src/commands/app/install.ts)_
214+
_See code: [src/commands/app/install.ts](https://github.com/contentstack/apps-cli/blob/v1.2.0/src/commands/app/install.ts)_
214215

215216
## `csdx app:reinstall`
216217

@@ -235,7 +236,7 @@ EXAMPLES
235236
$ csdx app:reinstall --org <UID> --app-uid <APP-UID-1> --stack-api-key <STACK-API-KEY-1>
236237
```
237238

238-
_See code: [src/commands/app/reinstall.ts](https://github.com/contentstack/apps-cli/blob/v1.1.1/src/commands/app/reinstall.ts)_
239+
_See code: [src/commands/app/reinstall.ts](https://github.com/contentstack/apps-cli/blob/v1.2.0/src/commands/app/reinstall.ts)_
239240

240241
## `csdx app:uninstall`
241242

@@ -261,7 +262,7 @@ EXAMPLES
261262
$ csdx app:uninstall --org <UID> --app-uid <APP-UID-1> --installation-uid <INSTALLATION-UID-1>
262263
```
263264

264-
_See code: [src/commands/app/uninstall.ts](https://github.com/contentstack/apps-cli/blob/v1.1.1/src/commands/app/uninstall.ts)_
265+
_See code: [src/commands/app/uninstall.ts](https://github.com/contentstack/apps-cli/blob/v1.2.0/src/commands/app/uninstall.ts)_
265266

266267
## `csdx app:update`
267268

@@ -283,5 +284,5 @@ EXAMPLES
283284
$ csdx app:update --app-manifest ./boilerplate/manifest.json
284285
```
285286

286-
_See code: [src/commands/app/update.ts](https://github.com/contentstack/apps-cli/blob/v1.1.1/src/commands/app/update.ts)_
287+
_See code: [src/commands/app/update.ts](https://github.com/contentstack/apps-cli/blob/v1.2.0/src/commands/app/update.ts)_
287288
<!-- commandsstop -->

src/commands/app/deploy.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ export default class Deploy extends AppCLIBaseCommand {
4646
"app-url": Flags.string({
4747
description: deployAppMsg.APP_URL,
4848
}),
49-
yes: Flags.boolean({
50-
char: "y",
51-
description: deployAppMsg.FORCE_DISCONNECT,
52-
default: false,
53-
}),
5449
"launch-project": Flags.string({
5550
multiple: false,
5651
options: ["existing", "new"],
@@ -291,4 +286,4 @@ export default class Deploy extends AppCLIBaseCommand {
291286
);
292287
}
293288
}
294-
}
289+
}

src/util/common-utils.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,17 +313,14 @@ async function getProjects(
313313
node: {
314314
uid,
315315
name,
316-
latestDeploymentStatus: {
317-
deployment: { url },
318-
environment: { uid: environmentUid },
319-
},
316+
latestDeploymentStatus,
320317
integrations: { developerHubApp },
321318
},
322319
}) => ({
323320
name,
324321
uid,
325-
url,
326-
environmentUid,
322+
url: latestDeploymentStatus?.deployment?.url || null,
323+
environmentUid: latestDeploymentStatus?.environment?.uid || null,
327324
developerHubAppUid: developerHubApp?.uid || null,
328325
})
329326
);

0 commit comments

Comments
 (0)