From 66d90d20ce48d9593b89534af5eb140e038cc8ca Mon Sep 17 00:00:00 2001 From: Tyler Kellen Date: Tue, 6 May 2014 10:51:34 -0400 Subject: [PATCH] Update: Revise for liftoff 0.10 --- README.md | 4 ++-- bin/hacker.js | 12 +++++------- package.json | 3 ++- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 66cc042..ce5c90c 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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` diff --git a/bin/hacker.js b/bin/hacker.js index 713edc5..e181e56 100755 --- a/bin/hacker.js +++ b/bin/hacker.js @@ -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); @@ -42,3 +38,5 @@ function launcher (env) { console.log('No Hackerfile found.'); } } + +Hacker.launch(launcher); diff --git a/package.json b/package.json index d1dab21..c62d080 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,8 @@ "task runner" ], "dependencies": { - "liftoff": "~0.9.0" + "liftoff": "~0.10.0", + "interpret": "^0.3.0" }, "devDependencies": {} }