Skip to content

Commit 2476691

Browse files
committed
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.
1 parent e3ccebd commit 2476691

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/cli.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ function loadConfig(configPath) {
2121
return require(path.resolve(configPath))
2222
}
2323

24-
function writeStrategy(program) {
25-
if (program.output === undefined) {
24+
function writeStrategy(options) {
25+
if (options.output === undefined) {
2626
return (output) => {
2727
process.stdout.write(output)
2828
}
2929
}
3030
return (output) => {
31-
fs.outputFileSync(program.output, output)
31+
fs.outputFileSync(options.output, output)
3232
}
3333
}
3434

@@ -67,15 +67,15 @@ program.command('build')
6767
.usage('[options] <file ...>')
6868
.option('-c, --config [path]', 'Path to config file')
6969
.option('-o, --output [path]', 'Output file')
70-
.action(function () {
70+
.action(function (file, options) {
7171
let inputFile = program.args[0]
7272

7373
if (! inputFile) {
7474
console.error('No input file given!')
7575
process.exit(1)
7676
}
7777

78-
buildTailwind(inputFile, loadConfig(program.config), writeStrategy(program))
78+
buildTailwind(inputFile, loadConfig(program.config), writeStrategy(options))
7979
.then(function () {
8080
process.exit()
8181
})

0 commit comments

Comments
 (0)