Try without cloning again

This commit is contained in:
Oliver Davies 2017-07-25 19:16:51 +01:00
parent 9986ffd2ae
commit a2639310b0

View file

@ -6,11 +6,13 @@ SITE_ENV="prod"
REPO=`git config remote.origin.url` REPO=`git config remote.origin.url`
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:} SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}
SHA=`git rev-parse --verify HEAD` SHA=`git rev-parse --verify HEAD`
BUILD_DIR="_deploy" BUILD_DIR=".build"
# Prepare the build directory. # Prepare the build directory.
git clone $REPO $BUILD_DIR mkdir -p $BUILD_DIR
pushd $BUILD_DIR pushd $BUILD_DIR
cp -R ../.git .
git fetch
git checkout master || git checkout --orphan master git checkout master || git checkout --orphan master
popd popd
rm -rf ${BUILD_DIR}/**/* || exit 0 rm -rf ${BUILD_DIR}/**/* || exit 0