UNPKG

744 BPlain TextView Raw
1#!/usr/bin/env coffee
2
3# module dependencies
4Hey = require '../'
5program = require 'commander'
6fs = require 'fs'
7
8# Hey, Jack!
9hey = new Hey
10
11# set a default cli option
12process.argv.push '--server' if process.argv.length is 2
13
14# setup cli
15program.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
23do hey.build if program.build
24do hey.init if program.init
25do hey.publish if program.publish
26do hey.server if program.server