-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
32 lines (28 loc) · 867 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env node
const cliparse = require('cliparse');
const pkg = require('./package.json');
const fs = require('fs');
const compile = require('./lib/compile');
cliparse.parse(cliparse.cli({
name: 'concise-cli',
description: 'Command-line Interface for Concise Framework',
version: pkg.version,
commands: [
cliparse.command(
'compile', {
description: 'Compile code from Concise Framework',
args: [
cliparse.argument('input', { description: 'File to compile' }),
cliparse.argument('output', { description: 'Output CSS file' })
]
}, (params) => {
fs.writeFile(params.args[1], compile(params.args[0]), (err) => {
if (err) {
throw err;
}
console.log(`File written: ${params.args[1]}\nFrom: ${params.args[0]}`);
})
}
)
]
}));