-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·84 lines (79 loc) · 1.85 KB
/
install
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
#!/bin/sh
#
# specify dependencies as a list of {dir|file}:{symlink|spec} lines
# spec := COPY -- copy file; BUNDLE -- append file to a bundle
#
deps='
dvv/simple/lib:simple
Modernizr/Modernizr/modernizr.js:COPY
douglascrockford/JSON-js/json2.js:BUNDLE
documentcloud/underscore/underscore.js:BUNDLE
dvv/simple/lib/object.js:BUNDLE
dvv/simple/lib/rql.js:BUNDLE
dvv/simple/lib/validate.js:BUNDLE
documentcloud/backbone/backbone.js:BUNDLE
#edtsech/underscore.string/lib/underscore.string.js:BUNDLE
dvv/schema2form/index.js:BUNDLE
#weaver/node-mail/lib/mail:mail
#
#cloudhead/vows/lib:vows
#dvv/Faker.js:faker
'
#
# DO NOT CHANGE AFTER THIS LINE
#
#
# download dependencies
#
lib=node_modules
COPY=public/js
BUNDLE=public/js/bundle.js
mkdir -p "$lib"
rm -f "$BUNDLE"
for dep in $deps; do
# skip comments
case "$dep" in
\#*) continue ;;
esac
# parse definition
path=${dep%:*}
link=${dep##*:}
author=${path%%/*}
path=${path#*/}
git=${path%%/*}
# fetch the package
echo -n "package ${author}'s $git: "
#continue
if ! test -d git/${git}; then
#git clone https://github.com/${author}/${git}.git git/${git}
mkdir -p git/${git}
wget -ct3 -q --progress=bar --no-check-certificate http://nodeload.github.com/${author}/${git}/tarball/master -O- | tar -xzf- --strip 1 -C git/${git}
cd git/${git}
#if test -f Makefile; then
# make
#fi
if test -f wscript; then
node-waf distclean configure build
fi
cd ../..
fi
# symlink entry point
if test "Q$link" = 'QBUNDLE'; then
echo "$path bundled into $BUNDLE"
cat "git/$path" >> "$BUNDLE"
elif test "Q$link" = 'QCOPY'; then
echo "$path copied to $COPY"
cp "git/$path" "$COPY"
elif test "Q$link" != 'Q'; then
echo "$path symlinked to $lib/$link"
test -e "$lib/$link" || ln -s "../git/$path" "$lib/$link"
fi
done
#
# compile coffee
#
coffee -bc -o lib src/*
#
# minify client-side stuff
#
#jsmin "$BUNDLE"