This repository was archived by the owner on Jan 16, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ func (n *newCmd) shouldCreateNewApp(e *env) string {
188188 var decision string
189189 fmt .Fprintf (e .Out ,
190190 `Would you like to create a new app, or add Cloud Code to an existing app?
191- Type "new " or "existing ": ` )
191+ Type "(n)ew " or "(e)xisting ": ` )
192192 fmt .Fscanf (e .In , "%s\n " , & decision )
193193 return strings .ToLower (decision )
194194}
@@ -249,24 +249,21 @@ func (n *newCmd) run(e *env) error {
249249 app * app
250250 err error
251251 )
252- decision := n .shouldCreateNewApp (e )
253- if decision != "new" && decision != "existing" {
254- return errors .New ("`new` and `existing` are the only valid options" )
255- }
256-
257252 isNew := false
258- switch decision {
259- case "new" :
253+ switch n . shouldCreateNewApp ( e ) {
254+ case "new" , "n" :
260255 isNew = true
261256 app , err = apps .createApp (e )
262257 if err != nil {
263258 return err
264259 }
265- case "existing" :
260+ case "existing" , "e" :
266261 app , err = addCmd .selectApp (e )
267262 if err != nil {
268263 return err
269264 }
265+ default :
266+ return errors .New ("`new` and `existing` are the only valid options" )
270267 }
271268
272269 if err := n .setupSample (e , app , isNew ); err != nil {
You can’t perform that action at this time.
0 commit comments