1-
21import { color } from '@heroku/heroku-cli-util'
32import { Command , flags } from '@heroku-cli/command'
3+ import * as Heroku from '@heroku-cli/schema'
44import { Args , ux } from '@oclif/core'
55import tsheredoc from 'tsheredoc'
66
77import createAddon from '../../lib/addons/create_addon.js'
8+ import * as util from '../../lib/addons/util.js'
89import notify from '../../lib/notify.js'
10+
911const heredoc = tsheredoc . default
1012
1113function parseConfig ( args : string [ ] ) {
@@ -46,9 +48,9 @@ export default class Create extends Command {
4648 }
4749
4850 static description = heredoc `
49- Create a new add-on resource.
51+ Create a new add-on resource.
5052
51- In order to add additional config items, please place them at the end of the command after a double-dash (--).
53+ In order to add additional config items, please place them at the end of the command after a double-dash (--).
5254 `
5355
5456 static examples = [
@@ -76,15 +78,13 @@ export default class Create extends Command {
7678
7779 static strict = false
7880
79- static topic = 'addons'
80-
8181 public async run ( ) : Promise < void > {
8282 this . allowArbitraryFlags = true
8383 const { args, flags, ...restParse } = await this . parse ( Create )
8484 const { app, as, confirm, name, wait} = flags
8585 const servicePlan = args [ 'service:plan' ]
86- const argv = ( restParse . argv as string [ ] )
8786 // oclif duplicates specified args in argv
87+ const argv = ( restParse . argv as string [ ] )
8888 . filter ( arg => arg !== servicePlan )
8989
9090 if ( restParse . nonExistentFlags && restParse . nonExistentFlags . length > 0 ) {
@@ -93,9 +93,9 @@ export default class Create extends Command {
9393 }
9494
9595 const config = parseConfig ( argv )
96- let addon
96+ let addon : Heroku . AddOn
9797 try {
98- addon = await createAddon ( this . heroku , app , servicePlan , confirm , wait , { config , name , as } )
98+ addon = await createAddon ( this . heroku , app , servicePlan , confirm , wait , { as , config , name } )
9999 if ( wait ) {
100100 Create . notifier ( `heroku addons:create ${ addon . name } ` , 'Add-on successfully provisioned' )
101101 }
@@ -109,6 +109,6 @@ export default class Create extends Command {
109109
110110 await this . config . runHook ( 'recache' , { addon, app, type : 'addon' } )
111111 // eslint-disable-next-line no-unsafe-optional-chaining
112- ux . stdout ( `Use ${ color . code ( 'heroku addons:docs ' + addon ?. addon_service ?. name || '' ) } to view documentation` )
112+ ux . stdout ( `Run ${ color . code ( 'heroku addons:docs ' + addon ?. addon_service ?. name || '' ) } to view documentation. ` )
113113 }
114114}
0 commit comments