Skip to content

Commit

Permalink
script: more development support
Browse files Browse the repository at this point in the history
  • Loading branch information
ServarrAdmin committed Dec 22, 2024
1 parent 3ba10a5 commit ca1c74d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions scripts/indexer-sync-v2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit ca1c74d

Please sign in to comment.