Skip to content

Commit

Permalink
Update: Revise for liftoff 0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Kellen authored and phated committed Dec 24, 2018
1 parent ce6e8db commit 66d90d2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#### Options
- `--cwd` specify the working directory to run hacker
- `--hackerfile` specify an exact hackerfile path
- `--require` require an external module before loading your hackerfile (e.g. coffee-script)
- `--require` require an external module before loading your hackerfile
- `--verbose` show some debugging info about how hacker is working

### Examples
Expand All @@ -30,4 +30,4 @@ fs = require 'fs'
fs.writeFileSync 'tmp', 'i will be written relative to this file, always.'
```
To run:
`hacker --require coffee-script`
`hacker`
12 changes: 5 additions & 7 deletions bin/hacker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,21 @@ var Hacker = new Liftoff({
// localDeps: ['hacker'], // these are assigned
// configName: 'hackerfile', // automatically by
// processTitle: 'hacker', // the "name" option
extensions: require('interpret').extensions,
cwdOpt: 'cwd',
requireOpt: 'require'
}).on('require', function (name, module) {
if (name === 'coffee-script') {
module.register();
}
console.log('Loading:',name);
}).on('requireFail', function (name, err) {
console.log('Unable to load:', name, err);
});

Hacker.launch(launcher);

function launcher (env) {
var launcher = function (env) {
if(env.argv.verbose) {
console.log('LIFTOFF SETTINGS:', this);
console.log('CLI OPTIONS:', env.argv);
console.log('CWD:', env.cwd);
console.log('LOCAL MODULES PRELOADED:', env.preload);
console.log('EXTENSIONS RECOGNIZED:', env.validExtensions);
console.log('SEARCHING FOR:', env.configNameRegex);
console.log('FOUND CONFIG AT:', env.configPath);
console.log('CONFIG BASE DIR:', env.configBase);
Expand All @@ -42,3 +38,5 @@ function launcher (env) {
console.log('No Hackerfile found.');
}
}

Hacker.launch(launcher);
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"task runner"
],
"dependencies": {
"liftoff": "~0.9.0"
"liftoff": "~0.10.0",
"interpret": "^0.3.0"
},
"devDependencies": {}
}

0 comments on commit 66d90d2

Please # to comment.