-
Notifications
You must be signed in to change notification settings - Fork 15
/
init.js
executable file
·65 lines (63 loc) · 2.27 KB
/
init.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
54
55
56
57
58
59
60
61
62
63
64
65
_ = require( "underscore" );
require( "./lib/underscorePatch" )( _ );
var commander = require( "commander" );
var machina = require( "machina" );
var postal = require( "postal" );
var fs = require( "fs" );
var path = require( "path" );
var colors = require( "colors" );
var mkdir = require( "mkdirp" ).mkdirp;
var scheduler = require( "./lib/scheduler.js" )( _ );
var crawler = require( "./lib/fileCrawler.js" )( _, fs, path, scheduler );
var Monologue = require( "monologue.js" )( _ );
var minimatch = require( "minimatch" );
var files = require( "./lib/fileSystem.js" )( _, fs, path, mkdir, crawler, minimatch, scheduler, Monologue );
var postal = require( "postal" );
var bridge = require( "monopost" );
bridge( _, Monologue, postal );
var bus = require( "./lib/bus.js")( _, postal );
var anvil = require( "./lib/anvil.js" )( _, scheduler, files, Monologue, bus );
require( "./lib/utility.js")( _, anvil );
var plugin = require( "./lib/plugin.js" )( _, anvil );
var log = require( "./lib/log.js" )( anvil );
var consoleLog = require( "./lib/consoleLogger.js" )( _, anvil );
var manager = require( "./lib/extensionManager.js" )( _, anvil );
var container = require( "./lib/extensionContainer.js" )( _, manager, anvil );
var config = require( "./lib/config.js" )( _, commander, path, anvil );
var plugins = [
"anvil.combiner",
"anvil.concat",
"anvil.headers",
"anvil.identify",
"anvil.output",
"anvil.extension",
"anvil.scaffold.cli",
"anvil.scaffolding",
"anvil.task.cli",
"anvil.token",
"anvil.transform",
"anvil.testem",
"anvil.workset"
];
anvil.on( "all.stop", function() {
process.exit();
} );
anvil.log.step( "Checking for core plugins" );
manager.checkDependencies( plugins, function() {
anvil.log.complete( "Core dependencies are installed" );
var timeout = setTimeout( function() {
anvil.log.event( "\nTimed out waiting for your response. Updates will not be installed." );
process.exit();
}, 5000 );
commander.prompt( "Check for updates for all installed plugins? (this could take a minute)\n ([Y]/N): ", function( resp ) {
if( resp === "y" || resp === "Y" || resp === "" ) {
clearTimeout( timeout );
manager.update( function() {
anvil.log.complete( "All installed plugins are up to date!" );
process.exit();
} );
} else {
process.exit();
}
} );
} );