1
0
Fork 0
mirror of https://git.ludikovsky.name/git/fugitive.git synced 2024-05-18 06:25:33 +02:00
fugitive/build.sh

23 lines
387 B
Bash
Executable file

#!/bin/bash
include_file() {
f=`echo -n $2 | sed 's/\//\\\\\//g'`
tmp=`mktemp --suffix "-fugitive"`
cat "$2" | gzip | base64 > "$tmp"
cat "$1" | sed "/#INCLUDE:$f#/ {
r $tmp
d }"
rm "$tmp"
}
cp install.sh tmp1
i=1
for f in README *-*.sh default-files/*; do
j=$((1 - i))
include_file tmp$i "$f" > tmp$j
i=$j
done
cp tmp$j fugitive
chmod +x fugitive
rm tmp0 tmp1