2010-07-23 11:48:56 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
include_file() {
|
2010-07-25 00:57:27 +02:00
|
|
|
f=`echo -n $2 | sed 's/\//\\\\\//g'`
|
2010-07-23 11:48:56 +02:00
|
|
|
tmp=`tempfile -p "figitive"`
|
|
|
|
cat "$2" | gzip | base64 > "$tmp"
|
2010-07-25 00:57:27 +02:00
|
|
|
cat "$1" | sed "/#INCLUDE:$f#/ {
|
2010-07-23 11:48:56 +02:00
|
|
|
r $tmp
|
|
|
|
d }"
|
|
|
|
rm "$tmp"
|
|
|
|
}
|
|
|
|
|
|
|
|
cp install.sh tmp1
|
|
|
|
i=1
|
2010-08-02 13:49:17 +02:00
|
|
|
for f in README post-commit.sh post-receive.sh html-gen.sh default-files/*; do
|
2010-07-23 11:48:56 +02:00
|
|
|
j=$((1 - i))
|
2010-07-25 00:57:27 +02:00
|
|
|
include_file tmp$i "$f" > tmp$j
|
2010-07-23 11:48:56 +02:00
|
|
|
i=$j
|
|
|
|
done
|
|
|
|
cp tmp$j fugitive
|
|
|
|
chmod +x fugitive
|
|
|
|
rm tmp0 tmp1
|