fix scripts/get-repository.sh to match website/render.sh

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Nicolas Sebrecht 2015-03-12 17:54:15 +01:00
parent 65274312a6
commit e8280e642c

View File

@ -49,40 +49,6 @@ function setup () {
fi fi
} }
function write_renderer () {
cat <<EOF
#!/bin/bash
#
# Licence: this file is in the public deomain.
#
# Render the website at $1 OfflineIMAP fork.
username=$1
remote=git@github.com:\${username}/offlineimap.git
function clean() {
echo "Cleaning gh-pages from public fork $username at ${remote}..."
git push "\$remote" :gh-pages && {
echo "\nSuccessfully terminated!"
exit 0
}
exit 1
}
if test "n\$username" = 'n'
then
echo "Github username is not configured"
exit 2
fi
git push \$remote HEAD:gh-pages && {
echo "\nCurrent HEAD pushed to Github fork of offlineimap.git."
echo "Visit http://${username}.github.io/offlineimap to see how it is rendered"
echo "Press Ctrl+C once done"
}
EOF
}
function configure_website () { function configure_website () {
renderer='./render.sh' renderer='./render.sh'
@ -92,11 +58,10 @@ function configure_website () {
cd ./website cd ./website
if test $? -eq 0 if test $? -eq 0
then then
write_renderer "$1" > "$renderer" sed -r -i -e "s,{{USERNAME}},$1," "$renderer"
chmod u+x "$renderer"
cd .. cd ..
else else
echo "ERROR: could not write renderer." echo "ERROR: could not enter ./website. (?)"
fi fi
} }