File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ const { shortPolling } = require('./utils/polling');
1212async function storybook ( serve , options ) {
1313 let type = / ^ h t t p s ? : \/ \/ / . test ( serve ) ? 'url' : 'dir' ;
1414 let storybookConfig = options . config ? options . config : defaultSmartUIConfig . storybook ;
15+ const buildName = options . buildName ? options . buildName : "" ;
1516
1617 if ( type === 'url' ) {
1718 await validateStorybookUrl ( serve ) ;
@@ -130,7 +131,8 @@ async function storybook(serve, options) {
130131 commitAuthor : commit . author . name ,
131132 commitMessage : commit . subject ,
132133 githubURL : process . env . GITHUB_URL || '' ,
133- }
134+ } ,
135+ buildName : buildName
134136 }
135137
136138 // Call static render API
Original file line number Diff line number Diff line change @@ -34,13 +34,17 @@ program.command('storybook')
3434 . argument ( '<url|directory>' , 'Storybook url or static build directory' )
3535 . option ( '-c --config <file>' , 'Config file path' )
3636 . option ( '--force-rebuild' , 'Force a rebuild of an already existing build.' , false )
37+ . option ( '--buildName <string>' , 'Specify the build name for the pipeline' )
3738 . action ( async function ( serve , options ) {
3839 options . env = program . opts ( ) . env || 'prod' ;
3940
4041 console . log ( 'SmartUI Storybook CLI v' + version ) ;
4142 await checkUpdate ( version , options ) ;
4243 console . log ( '\n' ) ;
43-
44+ if ( options . buildName === '' ) {
45+ console . log ( `Error: The '--buildName' option cannot be an empty string.` ) ;
46+ process . exit ( 1 ) ;
47+ }
4448 if ( options . config ) {
4549 options . config = validateConfig ( options . config ) ;
4650 }
You can’t perform that action at this time.
0 commit comments