frostney / react-native-create-library

:notebook: Command line tool to create a React Native library with a single command
MIT License
1.45k stars 113 forks source link

when there is no library's name with this cli, exception handling is needed #103

Open 738 opened 5 years ago

738 commented 5 years ago

Hello there

it is a kind of minor issue i think

when there is no library's name with this cli, exception handling is needed.

$ react-native-create-library
/Users/jonjee/.nvm/versions/node/v10.8.0/lib/node_modules/react-native-create-library/utils/isUpperCase.js:1
(function (exports, require, module, __filename, __dirname) { module.exports = (str, index) => str[index].toUpperCase() === str[index];
                                                                                                          ^

TypeError: Cannot read property 'toUpperCase' of undefined
    at module.exports (/Users/holykw/.nvm/versions/node/v10.8.0/lib/node_modules/react-native-create-library/utils/isUpperCase.js:1:107)
    at module.exports.name (/Users/holykw/.nvm/versions/node/v10.8.0/lib/node_modules/react-native-create-library/utils/hasPrefix.js:3:26)
    at module.exports (/Users/holykw/.nvm/versions/node/v10.8.0/lib/node_modules/react-native-create-library/lib.js:26:9)
    at Object.func (/Users/holykw/.nvm/versions/node/v10.8.0/lib/node_modules/react-native-create-library/command.js:19:5)
    at Command.runAction (/Users/holykw/.nvm/versions/node/v10.8.0/lib/node_modules/react-native-create-library/cli.js:15:13)
    at Command.listener (/Users/holykw/.nvm/versions/node/v10.8.0/lib/node_modules/react-native-create-library/node_modules/commander/index.js:315:8)
    at Command.emit (events.js:182:13)
    at Command.parseArgs (/Users/holykw/.nvm/versions/node/v10.8.0/lib/node_modules/react-native-create-library/node_modules/commander/index.js:668:12)
    at Command.parse (/Users/holykw/.nvm/versions/node/v10.8.0/lib/node_modules/react-native-create-library/node_modules/commander/index.js:474:21)
    at Object.<anonymous> (/Users/holykw/.nvm/versions/node/v10.8.0/lib/node_modules/react-native-create-library/cli.js:27:9)