-
Notifications
You must be signed in to change notification settings - Fork 2
/
messages.js
37 lines (26 loc) · 1.18 KB
/
messages.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const chalk = require('chalk');
const log = require('./log');
const { stripIndent } = require('common-tags');
const authRequired = () => {
log.error('Deploy key is required');
console.error('');
// prettier-ignore
console.error(stripIndent`
Your deploy key can be found under "Settings" in the UI.
There are couple ways to use your key:
- Use the ${log.variable('-k')} flag, or
- Set the ${log.variable('FORMSPREE_DEPLOY_KEY')} env variable
${chalk.yellow.bold('-- Examples -----------------------------------------------')}
The inline method looks like this:
${chalk.gray('$')} formspree deploy ${chalk.cyan('-k')} ${chalk.yellow('<your-deploy-key>')}
For convenience, you can add it to a ${log.variable('.env')} file.
That way, you don't have to copy/paste it every time
you run a command:
${chalk.gray('$')} echo "FORMSPREE_DEPLOY_KEY=${chalk.yellow('<your-deploy-key>')}" >> .env
${chalk.gray('$')} formspree deploy
Just be sure to add ${log.variable('.env')} to your ${log.variable('.gitignore')} file,
so your deploy key does not end up in version control.
`);
console.error('');
};
module.exports = { authRequired };