loaih/check_updates.sh

22 lines
498 B
Bash
Executable File

#!/bin/bash
pushd $(dirname $0)
# Checking if pull is successfull
git fetch origin
LC_ALL=C git status | grep -q "Your branch is up to date"; retval=$?
if [[ ${retval} -ne 0 ]]; then
# Let us update the pip installation
git pull
# for the sake of consistency, let's make the check_updates.sh script
# executable
chmod +x check_updates.sh
# Updating the environment is left to hatch itself.
if [[ ${rv} -eq 0 ]]; then
# cleanup
rm -rf dist build loaih.egg-info
fi
fi
popd