File tree Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,10 @@ async function storybook(serve, options) {
114114 }
115115
116116 let commit = await getLastCommit ( ) ;
117+ let baseLine ;
118+ if ( process . env . BASELINE_BRANCH !== undefined && process . env . BASELINE_BRANCH !== null && process . env . BASELINE_BRANCH !== '' )
119+ baseLine = process . env . BASELINE_BRANCH
120+ console . log ( `Baseline branch set :${ baseLine } ` )
117121 let payload = {
118122 downloadURL : url . substring ( url . search ( / .c o m / ) + 5 , url . search ( / .z i p / ) + 4 ) ,
119123 uploadId : uploadId ,
@@ -126,13 +130,14 @@ async function storybook(serve, options) {
126130 customViewports : storybookConfig . customViewports
127131 } ,
128132 git : {
129- branch : commit . branch ,
130- commitId : commit . shortHash ,
131- commitAuthor : commit . author . name ,
132- commitMessage : commit . subject ,
133+ branch : process . env . BRANCH_NAME ? process . env . BRANCH_NAME : commit . branch ,
134+ commitId : commit . shortHash ,
135+ commitAuthor : commit . author . name ,
136+ commitMessage : commit . subject ,
133137 githubURL : process . env . GITHUB_URL || '' ,
134138 } ,
135- buildName : buildName
139+ buildName : buildName ,
140+ baseline : baseLine ?? "" ,
136141 }
137142
138143 // Call static render API
Original file line number Diff line number Diff line change @@ -41,8 +41,13 @@ program.command('storybook')
4141 console . log ( 'SmartUI Storybook CLI v' + version ) ;
4242 await checkUpdate ( version , options ) ;
4343 console . log ( '\n' ) ;
44- if ( options . buildName === '' ) {
45- console . log ( `Error: The '--buildName' option cannot be an empty string.` ) ;
44+ // Check if buildName is undefined or empty string
45+ if ( options . buildName === undefined || options . buildName === '' ) {
46+ const error = {
47+ "error" : "MISSING_BUILD_NAME" ,
48+ "message" : "The --buildName flag requires a value."
49+ } ;
50+ console . log ( JSON . stringify ( error , null , 2 ) ) ;
4651 process . exit ( 1 ) ;
4752 }
4853 if ( options . config ) {
You can’t perform that action at this time.
0 commit comments