-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmake.coffee
executable file
·66 lines (55 loc) · 1.38 KB
/
make.coffee
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/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'