1 | #!/usr/bin/env coffee
|
2 |
|
3 | # module dependencies
|
4 | Hey = require '../'
|
5 | program = require 'commander'
|
6 | fs = require 'fs'
|
7 |
|
8 | # Hey, Jack!
|
9 | hey = new Hey
|
10 |
|
11 | # set a default cli option
|
12 | process.argv.push '--server' if process.argv.length is 2
|
13 |
|
14 | # setup cli
|
15 | program.version(JSON.parse(fs.readFileSync(__dirname + '/../package.json').toString()).version)
|
16 | .option('-i, --init', 'create a new blog in current directory')
|
17 | .option('-b, --build', 'update the cache and build out blog')
|
18 | .option('-p, --publish', 'update webserver with new/updated blog files')
|
19 | .option('-s, --server', 'test server')
|
20 | .parse process.argv
|
21 |
|
22 | # run
|
23 | do hey.build if program.build
|
24 | do hey.init if program.init
|
25 | do hey.publish if program.publish
|
26 | do hey.server if program.server
|