Skip to content

Instantly share code, notes, and snippets.

@tiye
Last active August 29, 2015 13:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiye/10336012 to your computer and use it in GitHub Desktop.
Save tiye/10336012 to your computer and use it in GitHub Desktop.
#!/usr/bin/env coffee
project = 'repo/todolist'
require 'shelljs/make'
path = require 'path'
mission = require 'mission'
mission.time()
target.folder = ->
mission.tree
'.gitignore': ''
'README.md': ''
js: {}
build: {}
cirru: {'index.cirru': ''}
coffee: {'main.coffee': ''}
css: {'style.css': ''}
target.coffee = ->
mission.coffee
find: /\.coffee$/, from: 'coffee/', to: 'js/', extname: '.js'
options:
bare: yes
cirru = ->
mission.cirru
file: 'index.cirru', from: 'cirru/', to: './', extname: '.html'
browserify = (callback) ->
mission.browserify
file: 'main.js', from: 'js/', to: 'build/', done: callback
target.cirru = -> cirru()
target.browserify = -> browserify()
target.compile = ->
cirru()
target.coffee yes
browserify()
target.watch = ->
station = mission.reload()
mission.watch
files: ['cirru/', 'coffee/']
trigger: (filepath, extname) ->
switch extname
when '.cirru'
cirru()
station.reload project
when '.coffee'
filepath = path.relative 'coffee/', filepath
mission.coffee
file: filepath, from: 'coffee/', to: 'js/', extname: '.js'
options:
bare: yes
browserify ->
station.reload project
target.pre = ->
target.compile()
mission.bump
file: 'package.json'
options:
at: 'prerelease'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment