Commit a66f6c3a authored by Camil Staps's avatar Camil Staps 🐧

Internalise put-commit-info.sh to update.sh; move to new util directory

parent 35ae4919
#!/bin/sh
# Changes {{{COMMIT} in FILE to information about the latest commit.
# May be useful to put in a git hook for index.html.
escape_sed() {
sed -e 's/\//\\\//g' -e 's/\&/\\\&/g'
}
if [ 1 -ne $# ]; then
echo "Usage: $0 FILE"
exit 1
fi
FILE="$1"
COMMIT_INFO="$(git log -1 --decorate --pretty=oneline --no-color | escape_sed)"
echo "$COMMIT_INFO"
sed -i "s/{{{COMMIT}}}/$COMMIT_INFO/g" "$FILE"
......@@ -2,6 +2,10 @@
CLEAR_CACHE=-1
INTERACTIVE=1
escape_sed() {
sed -e 's/\//\\\//g' -e 's/\&/\\\&/g'
}
while [ $# -gt 0 ]; do
case "$1" in
--interactive ) INTERACTIVE=1;;
......@@ -36,6 +40,9 @@ else
fi
git submodule update --init --recursive
COMMIT_INFO="$(git log -1 --decorate --pretty=oneline --no-color | escape_sed)"
sed -i "s/{{{COMMIT}}}/$COMMIT_INFO/g" "frontend/index.html"
echo "Updating containers..."
sudo docker-compose build --force-rm --no-cache --pull &> /tmp/cloogle-build.log
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment