Skip to content

Commit a7d90a7

Browse files
Aditya JoshiAditya Joshi
authored andcommitted
handled case when undefined buildName
1 parent 9a4d090 commit a7d90a7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff 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) {

0 commit comments

Comments
 (0)