UNPKG

1.11 kBJavaScriptView Raw
1'use strict';
2
3const boxen = require('boxen');
4const chalk = require('chalk');
5const isStandaloneExecutable = require('../lib/utils/isStandaloneExecutable');
6
7const isWindows = process.platform === 'win32';
8
9const truthyStr = val => val && !['0', 'false', 'f', 'n', 'no'].includes(val.toLowerCase());
10const { CI, ADBLOCK, SILENT } = process.env;
11if (!truthyStr(CI) && !truthyStr(ADBLOCK) && !truthyStr(SILENT)) {
12 const messageTokens = ['Serverless Framework successfully installed!'];
13 if (isStandaloneExecutable && !isWindows) {
14 messageTokens.push(
15 'To start your first project, please open another terminal and run “serverless”.',
16 'You can uninstall at anytime by running “serverless uninstall”.'
17 );
18 } else {
19 messageTokens.push("To start your first project run 'serverless'.");
20 }
21 const message = messageTokens.join('\n\n');
22 process.stdout.write(
23 `${
24 isStandaloneExecutable && isWindows
25 ? message
26 : boxen(chalk.yellow(message), {
27 padding: 1,
28 margin: 1,
29 borderColor: 'yellow',
30 })
31 }\n`
32 );
33}