From 24766911c1621eca776d37228b2be7c6ddc89727 Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Wed, 1 Nov 2017 09:23:53 -0400 Subject: [PATCH] Fix `tailwind build` CLI command Moving to subcommands broke this without us noticing. It's probably a good idea to add a big dirty integration test for this that just executes the CLI command and makes sure the file was created. --- src/cli.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cli.js b/src/cli.js index 1b942e257d9c..64096982a4d0 100755 --- a/src/cli.js +++ b/src/cli.js @@ -21,14 +21,14 @@ function loadConfig(configPath) { return require(path.resolve(configPath)) } -function writeStrategy(program) { - if (program.output === undefined) { +function writeStrategy(options) { + if (options.output === undefined) { return (output) => { process.stdout.write(output) } } return (output) => { - fs.outputFileSync(program.output, output) + fs.outputFileSync(options.output, output) } } @@ -67,7 +67,7 @@ program.command('build') .usage('[options] ') .option('-c, --config [path]', 'Path to config file') .option('-o, --output [path]', 'Output file') - .action(function () { + .action(function (file, options) { let inputFile = program.args[0] if (! inputFile) { @@ -75,7 +75,7 @@ program.command('build') process.exit(1) } - buildTailwind(inputFile, loadConfig(program.config), writeStrategy(program)) + buildTailwind(inputFile, loadConfig(program.config), writeStrategy(options)) .then(function () { process.exit() })