dh_ackergaul
vor 4 Tagen bb80cdf5a6157ca1f3a276e12e9faae9a4739cb7
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
38
39
40
/**
 * Module dependencies
 */
 
var _ = require('@sailshq/lodash')
    , util = require('util');
 
 
 
// Used to detect terminal-URL support (for help links)
var IS_MACOS = require('os').platform().match(/darwin/);
 
module.exports = {
 
    logMoreInfoLink: function(url, log) {
        log = log || console.log;
        if (IS_MACOS) {
            log('See ' + util.format('%s'.underline, url));
            log('(⌘ + double-click to open link from terminal)'.grey);
        } else return log(util.format('(see %s)', url));
    },
 
    logLinks: function(urls, log) {
        log = log || console.log;
        _.each(urls, function(url) {
            log(' ->', util.format('%s'.underline, url));
        });
        if (IS_MACOS) {
            log('    (⌘ + double-click to open links from terminal)'.grey);
        }
        module.exports.terminalLinkHelp(log);
    },
 
    terminalLinkHelp: function (log) {
        log = log || console.log;
        if (IS_MACOS) {
            log('(⌘ + double-click to open links from terminal)'.grey);
        }
    }
};