11#!/usr/bin/env node
2- 'use strict' ;
2+ const Liftoff = require ( 'liftoff' ) ;
3+ const argv = require ( 'minimist' ) ( process . argv . slice ( 2 ) ) ;
34
4- var Liftoff = require ( 'liftoff' ) ;
5-
6- var Hacker = new Liftoff ( {
5+ const Hacker = new Liftoff ( {
76 name : 'hacker' ,
8- // localDeps: ['hacker'], // these are assigned
9- // configName: 'hackerfile', // automatically by
10- // processTitle: 'hacker', // the "name" option
11- extensions : require ( 'interpret' ) . extensions ,
12- cwdOpt : 'cwd' ,
13- requireOpt : 'require'
7+ // moduleName: 'hacker', // these are assigned
8+ // configName: 'hackerfile', // automatically by
9+ // processTitle: 'hacker', // the "name" option
10+ extensions : require ( 'interpret' ) . extensions
1411} ) . on ( 'require' , function ( name , module ) {
1512 console . log ( 'Loading:' , name ) ;
1613} ) . on ( 'requireFail' , function ( name , err ) {
1714 console . log ( 'Unable to load:' , name , err ) ;
1815} ) ;
1916
20- var launcher = function ( env ) {
21- if ( env . argv . verbose ) {
17+ Hacker . launch ( {
18+ cwd : argv . cwd ,
19+ configPath : argv . hackerfile ,
20+ require : argv . require ,
21+ completion : argv . completion ,
22+ verbose : argv . verbose
23+ } , invoke ) ;
24+
25+ function invoke ( env ) {
26+ if ( argv . verbose ) {
2227 console . log ( 'LIFTOFF SETTINGS:' , this ) ;
23- console . log ( 'CLI OPTIONS:' , env . argv ) ;
28+ console . log ( 'CLI OPTIONS:' , argv ) ;
2429 console . log ( 'CWD:' , env . cwd ) ;
25- console . log ( 'LOCAL MODULES PRELOADED:' , env . preload ) ;
30+ console . log ( 'LOCAL MODULES PRELOADED:' , env . require ) ;
2631 console . log ( 'SEARCHING FOR:' , env . configNameRegex ) ;
2732 console . log ( 'FOUND CONFIG AT:' , env . configPath ) ;
2833 console . log ( 'CONFIG BASE DIR:' , env . configBase ) ;
@@ -38,5 +43,3 @@ var launcher = function (env) {
3843 console . log ( 'No Hackerfile found.' ) ;
3944 }
4045}
41-
42- Hacker . launch ( launcher ) ;
0 commit comments