Security update for Core, with self-updated composer
[yaffs-website] / node_modules / grunt / node_modules / grunt-cli / lib / info.js
1 /*
2  * grunt-cli
3  * http://gruntjs.com/
4  *
5  * Copyright (c) 2016 Tyler Kellen, contributors
6  * Licensed under the MIT license.
7  * https://github.com/gruntjs/grunt-init/blob/master/LICENSE-MIT
8  */
9
10 'use strict';
11
12 // Project metadata.
13 var pkg = require('../package.json');
14
15 // Display grunt-cli version.
16 exports.version = function() {
17   console.log('grunt-cli v' + pkg.version);
18 };
19
20 // Show help, then exit with a message and error code.
21 exports.fatal = function(msg, code) {
22   exports.helpHeader();
23   console.log('Fatal error: ' + msg);
24   console.log('');
25   exports.helpFooter();
26   process.exit(code);
27 };
28
29 // Show help and exit.
30 exports.help = function() {
31   exports.helpHeader();
32   exports.helpFooter();
33   process.exit();
34 };
35
36 // Help header.
37 exports.helpHeader = function() {
38   console.log('grunt-cli: ' + pkg.description + ' (v' + pkg.version + ')');
39   console.log('');
40 };
41
42 // Help footer.
43 exports.helpFooter = function() {
44   [
45     'If you\'re seeing this message, grunt hasn\'t been installed locally to',
46     'your project. For more information about installing and configuring grunt,',
47     'please see the Getting Started guide:',
48     '',
49     'http://gruntjs.com/getting-started',
50   ].forEach(function(str) { console.log(str); });
51 };