-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.coffee
91 lines (78 loc) · 1.81 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/env coffee
project = 'topics.tiye.dev'
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 = (data) ->
mission.cirruHtml
file: 'index.cirru'
from: 'cirru/'
to: './'
extname: '.html'
data: data
browserify = (callback) ->
mission.browserify
file: 'main.js', from: 'js/', to: 'build/', done: callback
target.cirru = -> cirru inDev: yes
target.cirruBuild = -> cirru inBuild: yes
target.browserify = -> browserify()
target.dev = ->
cirru inDev: yes
target.coffee yes
browserify()
target.build = ->
cirru inBuild: yes
target.coffee yes
browserify()
target.watch = ->
station = mission.reload()
mission.watch
files: ['cirru/', 'coffee/']
trigger: (filepath, extname) ->
switch extname
when '.cirru'
cirru inDev: yes
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.patch = ->
mission.bump
file: 'package.json'
options:
at: 'patch'
target.rsync = ->
target.build()
mission.rsync
file: './'
dest: 'tiye:~/repo/topics.tiye.me/'
options:
exclude: [
'node_modules/'
'bower_components/'
'coffee'
'README.md'
'js'
'.git/'
'png/*.jpg'
]