From ca1c74dde2d91fcf7ffc39e953fd7d0b805a5b37 Mon Sep 17 00:00:00 2001 From: ServarrAdmin Date: Sun, 22 Dec 2024 12:40:43 -0600 Subject: [PATCH] script: more development support --- scripts/indexer-sync-v2.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/indexer-sync-v2.sh b/scripts/indexer-sync-v2.sh index 1a09942ed..61c025487 100644 --- a/scripts/indexer-sync-v2.sh +++ b/scripts/indexer-sync-v2.sh @@ -348,11 +348,18 @@ pull_cherry_and_merge() { existing_message_ln1=$(echo "$existing_message" | awk 'NR==1') prowlarr_commits=$(git log --format=%B -n1 -n 20 | grep "^$PROWLARR_COMMIT_TEMPLATE") prowlarr_jackett_commit_message=$(echo "$prowlarr_commits" | awk 'NR==1') + if [ "$is_jackett_dev" = true ]; then + # Use only local Jackett branch (no remote) + jackett_ref="$JACKETT_BRANCH" + else + # Normal usage: remote reference + jackett_ref="$JACKETT_REMOTE_NAME/$JACKETT_BRANCH" + fi if [ "$is_dev_exec" = true ] || [ "$is_jackett_dev" = true ]; then - log "DEBUG" "Jackett Remote is [$JACKETT_REMOTE_NAME/$JACKETT_BRANCH]" + log "DEBUG" "Jackett Remote is [$jackett_ref]" # read -r -p "Pausing to review commits. Press any key to continue." -n1 -s fi - jackett_recent_commit=$(git rev-parse "$JACKETT_REMOTE_NAME/$JACKETT_BRANCH") + jackett_recent_commit=$(git rev-parse "$jackett_ref") recent_pulled_commit=$(echo "$prowlarr_commits" | awk 'NR==1{print $5}') if [ -z "$recent_pulled_commit" ]; then @@ -363,7 +370,7 @@ pull_cherry_and_merge() { log "SUCCESS" "--- we are current with jackett; nothing to do ---" exit 0 fi - log "INFO" "[$jackett_recent_commit] is the most recent Jackett commit as per branch [$JACKETT_REMOTE_NAME/$JACKETT_BRANCH]" + log "INFO" "[$jackett_recent_commit] is the most recent Jackett commit as per branch [$jackett_ref]" log "INFO" "[$recent_pulled_commit] is the most recent Prowlarr/Indexer commit pulled from Jackett as per branch [$prowlarr_remote_name/$prowlarr_target_branch]" # Define the command to get the commit range commit_range_cmd="git log --reverse --pretty='%n%H' $recent_pulled_commit..$jackett_recent_commit"