Skip to content

Commit 4b23220

Browse files
fix: fixed yes flag issue in seed command
1 parent a8b0809 commit 4b23220

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

packages/contentstack-seed/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ To import content to your stack, you can choose from the following two sources:
1010
<!-- usagestop -->
1111
## Commands
1212
<!-- commands -->
13-
* [`csdx cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y <value>] [-s <value>] [--locale <value>]`](#csdx-cmstacksseed---repo-value---org-value--k-value--n-value--y-value--s-value---locale-value)
14-
* [`csdx cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y <value>] [-s <value>] [--locale <value>]`](#csdx-cmstacksseed---repo-value---org-value--k-value--n-value--y-value--s-value---locale-value)
13+
* [`csdx cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y] [-s <value>] [--locale <value>]`](#csdx-cmstacksseed---repo-value---org-value--k-value--n-value--y--s-value---locale-value)
14+
* [`csdx cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y] [-s <value>] [--locale <value>]`](#csdx-cmstacksseed---repo-value---org-value--k-value--n-value--y--s-value---locale-value)
1515

16-
## `csdx cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y <value>] [-s <value>] [--locale <value>]`
16+
## `csdx cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y] [-s <value>] [--locale <value>]`
1717

1818
Create a stack from existing content types, entries, assets, etc
1919

2020
```
2121
USAGE
22-
$ csdx cm:seed cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y <value>] [-s
23-
<value>] [--locale <value>]
22+
$ csdx cm:seed cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y] [-s <value>]
23+
[--locale <value>]
2424
2525
FLAGS
2626
-a, --alias=<value> Alias of the management token
@@ -29,7 +29,7 @@ FLAGS
2929
-o, --org=<value> Provide Organization UID to create a new stack
3030
-r, --repo=<value> GitHub organization name or GitHub user name/repository name.
3131
-s, --stack=<value> Provide the stack UID to seed content.
32-
-y, --yes=<value> [Optional] Skip the stack confirmation.
32+
-y, --yes [Optional] Skip the stack confirmation.
3333
3434
DESCRIPTION
3535
Create a stack from existing content types, entries, assets, etc
@@ -49,14 +49,14 @@ EXAMPLES
4949
$ csdx cm:stacks:seed --repo "account/repository" --org "your-org-uid" --stack-name "stack-name" //create a new stack in given org uid
5050
```
5151

52-
## `csdx cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y <value>] [-s <value>] [--locale <value>]`
52+
## `csdx cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y] [-s <value>] [--locale <value>]`
5353

5454
Create a stack from existing content types, entries, assets, etc
5555

5656
```
5757
USAGE
58-
$ csdx cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y <value>] [-s <value>]
59-
[--locale <value>]
58+
$ csdx cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y] [-s <value>] [--locale
59+
<value>]
6060
6161
FLAGS
6262
-a, --alias=<value> Alias of the management token
@@ -65,7 +65,7 @@ FLAGS
6565
-o, --org=<value> Provide Organization UID to create a new stack
6666
-r, --repo=<value> GitHub organization name or GitHub user name/repository name.
6767
-s, --stack=<value> Provide the stack UID to seed content.
68-
-y, --yes=<value> [Optional] Skip the stack confirmation.
68+
-y, --yes [Optional] Skip the stack confirmation.
6969
7070
DESCRIPTION
7171
Create a stack from existing content types, entries, assets, etc

packages/contentstack-seed/src/commands/cm/stacks/seed.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default class SeedCommand extends Command {
2020
'$ csdx cm:stacks:seed --repo "account/repository" --org "your-org-uid" --stack-name "stack-name" //create a new stack in given org uid',
2121
];
2222

23-
static usage = 'cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y <value>] [-s <value>] [--locale <value>]';
23+
static usage = 'cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y] [-s <value>] [--locale <value>]';
2424

2525
static flags: FlagInput = {
2626
repo: flags.string({
@@ -59,7 +59,7 @@ export default class SeedCommand extends Command {
5959
required: false,
6060
hidden: true,
6161
}),
62-
yes: flags.string({
62+
yes: flags.boolean({
6363
char: 'y',
6464
required: false,
6565
description: '[Optional] Skip the stack confirmation.',

packages/contentstack-seed/src/seed/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export interface ContentModelSeederOptions {
2727
stackUid: string | undefined;
2828
stackName: string | undefined;
2929
fetchLimit: string | undefined;
30-
skipStackConfirmation: string | undefined;
30+
skipStackConfirmation: boolean | undefined;
3131
isAuthenticated: boolean | false;
3232
managementToken?: string | undefined;
3333
alias?: string | undefined;
@@ -200,7 +200,7 @@ export default class ContentModelSeeder {
200200

201201
count = await this.csClient.getContentTypeCount(api_key, this.managementToken);
202202

203-
if (count > 0 && this._options.skipStackConfirmation !== 'yes') {
203+
if (count > 0 && !this._options.skipStackConfirmation) {
204204
const proceed = await inquireProceed();
205205

206206
if (!proceed) {

0 commit comments

Comments
 (0)