diff --git a/.git-build/git-build b/.git-build/git-build new file mode 100755 index 0000000..6a7e35c --- /dev/null +++ b/.git-build/git-build @@ -0,0 +1,24 @@ +#!/bin/bash + +# Verify ~/bin exists +[ ! -d $HOME/bin ] && mkdir $HOME/bin + +# Add ~/bin to $PATH +grep "\$HOME/bin" $HOME/.bashrc > /dev/null +[[ $? != 0 ]] && PATH="$PATH:/$HOME/bin" + +# Wait for git-build.sh to stop running +SECONDS=0 +# TODO: make timeout configurable +echo test +while [[ $SECONDS < 60 ]]; do + if [ ! -f $GITBUILDDIR/.LOCK ]; then + # Copy the script + cp git-build.sh $HOME/bin + exit 0 + fi + sleep 5 + SECONDS=$(( SECONDS + 5 )) +done + +echo "The auto-updated script has timed out!" diff --git a/.git-build/git-build.source b/.git-build/git-build.source new file mode 100644 index 0000000..b512f3c --- /dev/null +++ b/.git-build/git-build.source @@ -0,0 +1 @@ +https://tildegit.org/southerntofu/git-build.sh