Cleanup AppVeyor Git checkout more safely.

This commit is contained in:
John Hood
2016-10-29 21:05:25 -04:00
parent 9005ea6cf3
commit 723e7858bc
+3 -23
View File
@@ -2,12 +2,6 @@
#
# Cleanup for Appveyor peculiarities.
#
# This thing is dangerous. See "rm -rf *". It tries hard, but if it
# gets it wrong you will not be happy.
#
# Only run this on an Appveyor instance, where the consequences are
# nil.
#
# Echo, eval, and error on shell commands.
eeval()
@@ -31,26 +25,12 @@ exec 0</dev/null
# Mosh-specific environment
export LANG=en_US.UTF-8
# Make sure we're on Appveyor
if [ -z "$APPVEYOR_BUILD_FOLDER" ]; then
echo "$0: APPVEYOR_BUILD_FOLDER variable empty" >&2
exit 2
fi
# Make really, really sure we're in the build dir
cd $APPVEYOR_BUILD_FOLDER || exit 2
if [ "$(pwd)" = "$HOME" -o "$PWD" = "$HOME" ]; then
echo "$0: in home directory" >&2
exit 2
fi
set -e
case $1 in
before_build)
# Check that we're in a Mosh repo with mosh-1.2.5, then clean it mercilessly
# This repo was checked out with Windows Git, repair it for Cygwin.
eeval git config --local core.symlinks true
eeval "git describe 3c3b356cb5e387887499beb2eedddce185f36944 && rm -rf * && git reset --hard"
eeval git clean --force --quiet -x -d
eeval git reset --hard
;;
build_script)
eeval ./autogen.sh