@@ -9,7 +9,12 @@ import { App, getApp, getOrg } from "../services/bootstrap.js";
99import { createFeature , Feature , listFeatures } from "../services/features.js" ;
1010import { configStore } from "../stores/config.js" ;
1111import { handleError , MissingAppIdError } from "../utils/errors.js" ;
12- import { genFeatureKey , genTypes , KeyFormatPatterns } from "../utils/gen.js" ;
12+ import {
13+ genFeatureKey ,
14+ genTypes ,
15+ indentLines ,
16+ KeyFormatPatterns ,
17+ } from "../utils/gen.js" ;
1318import {
1419 appIdOption ,
1520 featureKeyOption ,
@@ -54,14 +59,15 @@ export const createFeatureAction = async (
5459
5560 spinner = ora ( `Creating feature...` ) . start ( ) ;
5661 const feature = await createFeature ( appId , name , key ) ;
57- const production = app . environments . find ( ( e ) => e . isProduction ) ;
5862 spinner . succeed (
59- `Created feature ${ chalk . cyan ( feature . name ) } with key ${ chalk . cyan ( feature . key ) } ${
60- production
61- ? ` at ${ chalk . cyan ( featureUrl ( baseUrl , production , feature ) ) } `
62- : ""
63- } .`,
63+ `Created feature ${ chalk . cyan ( feature . name ) } with key ${ chalk . cyan ( feature . key ) } :` ,
6464 ) ;
65+ const production = app . environments . find ( ( e ) => e . isProduction ) ;
66+ if ( production ) {
67+ console . log (
68+ indentLines ( chalk . magenta ( featureUrl ( baseUrl , production , feature ) ) ) ,
69+ ) ;
70+ }
6571 } catch ( error ) {
6672 spinner ?. fail ( "Feature creation failed." ) ;
6773 void handleError ( error , "Features Create" ) ;
0 commit comments