UNPKG

968 BJavaScriptView Raw
1const repo = 'https://github.com/bahmutov/generator-node-bahmutov'
2
3function lastMessage (msg) {
4 console.error(msg)
5 process.exit(-1)
6}
7
8function onGitOriginError (err) {
9 const gitOriginErrorMessage = `
10🔥 This generator assumes there is already a remote Git
11(probably GitHub or GitLab) repository where all code will live.
12Please set it up before running generator
13
14 git init
15 git remote add origin <remote git>
16
17See more details at ${repo}#remote
18`
19 console.error(err)
20 lastMessage(gitOriginErrorMessage)
21}
22
23function onMissingDescription () {
24 const msg = `
25🔥 Please provide a meaningful module description.
26A project without description is of no use to anyone.
27`
28 lastMessage(msg)
29}
30
31function onMissingKeywords () {
32 const msg = `
33🔥 Please provide a few comma-separated keywords.
34Good keywords make finding your module so much easier.
35`
36 lastMessage(msg)
37}
38
39module.exports = { onGitOriginError, onMissingDescription, onMissingKeywords }