-
Notifications
You must be signed in to change notification settings - Fork 0
/
aretha.js
executable file
·53 lines (44 loc) · 1.34 KB
/
aretha.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env node
var chalk = require('chalk');
var clear = require('clear');
var CLI = require('clui');
var figlet = require('figlet');
var parseArgs = require('minimist');
var file = require('./file.js');
var delay = require('./delay.js');
var EventEmitter = require('events');
var events = require('./events.js');
var composer = require('./composer.js');
var yarn = require("./yarn.js");
var extend = require('util')._extend
var args = process.argv.slice(2);
var options = parseArgs(args, {'default': {
'max-delay': 'abandoned',
'max-count': 0,
'info-only': false,
'verbose' : false,
'require-only': false,
}});
if (file.fileExists('.aretha.yml')) {
var optionsFile = file.readYamlFile('.aretha.yml');
options = extend(options,optionsFile);
}
options['max-delay'] = events.delayValue(options['max-delay']);
// clear();
console.log(
chalk.blue(
figlet.textSync('Aretha', { horizontalLayout: 'full' })
)
);
var eventEmitter = new EventEmitter();
events.subscriber(eventEmitter, options);
if (file.fileExists('composer.lock')) {
composer.testComposer(eventEmitter, options);
}else{
console.log(chalk.blue('No composer'));
}
if (file.fileExists('yarn.lock')) {
yarn.testYarn(eventEmitter, options);
}else{
console.log(chalk.blue('No yarn'));
}