Skip to content

Commit

Permalink
fix: regression from #177 local lux not being used in cli (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharygolba authored Jun 25, 2016
1 parent 67b9940 commit 785ebf1
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions bin/lux
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
#!/usr/bin/env node
'use strict';

const PWD = process.cwd();
const VERSION = require('../package.json').version;

const cli = require('commander');
const path = require('path');

function exec(cmd, ...args) {
cmd = require(path.join(__dirname, '..', 'dist', cmd))[cmd];
return cmd.apply(null, args);
let handler;

try {
handler = require(path.join(
PWD,
'node_modules',
'lux-framework',
'dist',
cmd
))[cmd];
} catch (err) {
handler = require(path.join(__dirname, '..', 'dist', cmd))[cmd];
}

return handler.apply(null, args);
}

function exit(code) {
Expand Down

0 comments on commit 785ebf1

Please sign in to comment.