Skip to content

Commit

Permalink
Prepend --prelude source
Browse files Browse the repository at this point in the history
  • Loading branch information
pateketrueke committed Dec 30, 2015
1 parent 430641d commit 1ac9927
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ var pkg = require('../package.json'),
runner = require('../lib');

var minimist = require('minimist'),
path = require('path');
path = require('path'),
fs = require('fs');

var cwd = process.cwd(),
argv = minimist(process.argv.slice(2), {
Expand Down Expand Up @@ -44,7 +45,8 @@ if (argv.version) {
try {
runner(argv, {
src: path.resolve(cwd, argv._[0] || 'test'),
dest: path.resolve(cwd, argv._[1] || 'generated')
dest: path.resolve(cwd, argv._[1] || 'generated'),
header: argv.prelude ? fs.readFileSync(argv.prelude) : ''
}, exit);
} catch (e) {
process.stderr.write('Error: ' + (e.message || e.toString()) + '\n');
Expand Down

0 comments on commit 1ac9927

Please sign in to comment.