From f0d600f3b884a086ede2226779fe0b2c424b06b5 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Fri, 13 Sep 2024 13:15:06 +0200 Subject: [PATCH] fix alias usage in git-pull-and-run-if-origin-changed --- bin/git-pull-and-run-if-origin-changed | 35 -------------------------- 1 file changed, 35 deletions(-) delete mode 100755 bin/git-pull-and-run-if-origin-changed diff --git a/bin/git-pull-and-run-if-origin-changed b/bin/git-pull-and-run-if-origin-changed deleted file mode 100755 index fa34e06a..00000000 --- a/bin/git-pull-and-run-if-origin-changed +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -if [ -z "$1" ]; then - echo "command missing in arguments" >&2 - exit 1 -fi - -shopt -s expand_aliases -source .aliases - -# get the current branch name -BRANCH=$(git rev-parse --abbrev-ref HEAD) - -while true; do - - # get the latest commit hashes from origin and local - git fetch origin - LOCAL=$(git rev-parse HEAD) - REMOTE=$(git rev-parse origin/$BRANCH) - - # check if the local branch differs from the remote branch - if [ "$LOCAL" == "$REMOTE" ]; then - echo "pulling changes from origin" - git pull origin $BRANCH - - # run the command - echo "Running $*" - "$@" - else - echo "no changes detected on the origin branch" - fi - - echo "waiting for 1 minute before checking again..." - sleep 60 -done