forked from Lukc/alsace.netlib.re
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject.zsh
99 lines (74 loc) · 1.7 KB
/
project.zsh
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
92
93
94
95
96
97
98
package=alsace.netlib.re
version="$(git log --format=oneline | wc -l)"
targets=(
index.xhtml legal.xhtml technical.xhtml
$package.css
)
type[index.xhtml]=moon-xhtml
type[legal.xhtml]=moon-xhtml
type[technical.xhtml]=moon-xhtml
type[$package.css]=sass
for image in *.png; do
targets+=($image)
type[$image]=asset
done
# ###
# CUSTOM TYPE DEFINITIONS FOR build.zsh BELOW
#
# Most people should not have to edit this. If you NEED to edit it and don’t
# know how, ask Lukc on IRC or XMPP.
# ###
variables+=(
VARSTATEDIR '/var'
PUBDIR '$(VARSTATEDIR)/alsace.netlib.re'
)
# ASSETS
function asset.build {
:
}
function asset.install {
if [[ -z "${install[$target]}" ]]; then
install[$target]='$(PUBDIR)'
fi
binary.install "$@"
}
function asset.uninstall {
if [[ -z "${install[$target]}" ]]; then
install[$target]='$(PUBDIR)'
fi
binary.uninstall "$@"
}
function asset.clean {
write "${target}.clean:"
write "\t:"
write "\n"
}
# XHTML (from Moonscript)
function moon-xhtml.build {
write -n "${target}: template.moon class.moon"
if [[ -e "${target%.xhtml}.moon" ]]; then
write -n " ${target%.xhtml}.moon"
write ""
write "\t@echo '${fg_bold[yellow]} MOON > ${fg_bold[white]}$target${reset_color}'"
write "\t${Q}moon ${target%.xhtml}.moon > ${target}"
fi
write "\n"
}
function moon-xhtml.install {
asset.install "$@"
}
function moon-xhtml.uninstall {
asset.uninstall "$@"
}
# SASS
function sass.build {
write "${target}: ${target%.css}.sass"
write "\t@echo '${fg_bold[blue]} SASSC > ${fg_bold[white]}$target${reset_color}'"
write "\t${Q}sassc ${target%.css}.sass > ${target}"
}
function sass.install {
moon-xhtml.install "$@"
}
function sass.uninstall {
moon-xhtml.uninstall "$@"
}