#871 - Updating only if doesn't have commit

pull/829/head
Augusto Monteiro 'Sparky 2017-07-05 16:01:22 -04:00 committed by Steve Penrod
parent 9d9429a664
commit dfa64942ea
1 changed files with 6 additions and 1 deletions

View File

@ -166,10 +166,15 @@ cd "${mycroft_skill_folder}"
for d in $(find "${mycroft_skill_folder}" -mindepth 1 -maxdepth 1 -type d |grep -v '.git'$ ); do for d in $(find "${mycroft_skill_folder}" -mindepth 1 -maxdepth 1 -type d |grep -v '.git'$ ); do
if git -C "$d" rev-parse --git-dir > /dev/null 2>&1; then if git -C "$d" rev-parse --git-dir > /dev/null 2>&1; then
cd "${d}" cd "${d}"
UPSTREAM=${1:-'@{u}'}
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse "$UPSTREAM")
BASE=$(git merge-base @ "$UPSTREAM")
if ! grep -q '.pyc'$ .git/info/exclude; then if ! grep -q '.pyc'$ .git/info/exclude; then
echo "*.pyc" >> .git/info/exclude echo "*.pyc" >> .git/info/exclude
fi fi
if [[ -z $(git status --porcelain) ]]; then if [[ (-z $(git status --porcelain)) && !($LOCAL != $REMOTE && $REMOTE = $BASE) ]]; then
git fetch git fetch
git reset --hard origin/master git reset --hard origin/master
rm -f *.pyc rm -f *.pyc