Skip to content

Commit 9b2a981

Browse files
nihonjinrxsdkundel
authored andcommitted
feat(activate): change activate to alias, promote to command (#95)
Makes 'promote' the primary command, with alias 'activate'. Adds option aliases: * 'from' = 'source-environment' * 'from-build' = 'build-sid' * 'to' = 'environment' Adds appropriate examples showing usage. resolves #8
1 parent 1de3853 commit 9b2a981

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/commands/activate.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,18 @@ export const cliInfo: CliInfo = {
8383
},
8484
'build-sid': {
8585
type: 'string',
86+
alias: 'from-build',
8687
describe: 'An existing Build SID to deploy to the new environment',
8788
},
8889
'source-environment': {
8990
type: 'string',
91+
alias: 'from',
9092
describe:
9193
'SID or suffix of an existing environment you want to deploy from.',
9294
},
9395
environment: {
9496
type: 'string',
97+
alias: 'to',
9598
describe: 'The environment suffix or SID to deploy to.',
9699
requiresArg: true,
97100
},
@@ -132,11 +135,19 @@ export const cliInfo: CliInfo = {
132135
function optionBuilder<T>(yargs: Argv<any>): Argv<ActivateCliFlags> {
133136
yargs = yargs
134137
.example(
135-
'$0 activate --environment=prod --source-environment=dev ',
138+
'$0 promote --environment=prod --source-environment=dev ',
136139
'Promotes the same build that is on the "dev" environment to the "prod" environment'
137140
)
138141
.example(
139-
'$0 activate --environment=demo --create-environment --build-sid=ZB1234xxxxxxxxxx',
142+
'$0 promote --to=prod --from=dev ',
143+
'Promotes the same build that is on the "dev" environment to the "prod" environment'
144+
)
145+
.example(
146+
'$0 promote --environment=demo --create-environment --build-sid=ZB1234xxxxxxxxxx',
147+
'Duplicates an existing build to a new environment called `demo`'
148+
)
149+
.example(
150+
'$0 promote --to=demo --create-environment --from-build=ZB1234xxxxxxxxxx',
140151
'Duplicates an existing build to a new environment called `demo`'
141152
);
142153

@@ -147,6 +158,6 @@ function optionBuilder<T>(yargs: Argv<any>): Argv<ActivateCliFlags> {
147158
return yargs;
148159
}
149160

150-
export const command = ['activate', 'promote'];
161+
export const command = ['promote', 'activate'];
151162
export const describe = 'Promotes an existing deployment to a new environment';
152163
export const builder = optionBuilder;

0 commit comments

Comments
 (0)