Skip to content

Commit 62b391e

Browse files
committed
Added supportEmail to init script
1 parent 7004ea1 commit 62b391e

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

bin/lib/options.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const fs = require('fs')
22
const path = require('path')
33
const validUrl = require('valid-url')
44
const { URL } = require('url')
5+
const { isEmail } = require('validator')
56

67
module.exports = [
78
// {
@@ -349,6 +350,17 @@ module.exports = [
349350
prompt: true,
350351
validate: validUri,
351352
when: answers => answers.enforceToc
353+
},
354+
{
355+
name: 'support-email',
356+
help: 'The support email you provide for your users (not required)',
357+
prompt: true,
358+
validate: (value) => {
359+
if (value && !isEmail(value)) {
360+
return 'Must be a valid email'
361+
}
362+
return true
363+
}
352364
}
353365
]
354366

config.json-default

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
"logo": ""
1717
},
1818
"enforceToc": true,
19-
"tocUri": "https://your-toc"
19+
"tocUri": "https://your-toc",
20+
"supportEmail": "Your support email address"
2021
}

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
"ulid": "^0.1.0",
8383
"uuid": "^3.0.0",
8484
"valid-url": "^1.0.9",
85+
"validator": "^10.9.0",
8586
"vhost": "^3.0.2",
8687
"webid": "^0.3.11"
8788
},

0 commit comments

Comments
 (0)