Skip to content

Commit

Permalink
fix backport indexer-sync with sed
Browse files Browse the repository at this point in the history
fix commit and push debug loop
  • Loading branch information
bakerboy448 authored Jun 8, 2024
1 parent b7d2ec1 commit c7ba65d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions scripts/indexer-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ if [ -n "$modified_indexers_vcheck" ]; then
for ((i = max_schema; i >= min_schema; i--)); do
version="v$i"
echo "--- looking for [$version] indexer of [$indexer]"
indexer_check=${indexer/v[0-9]+/$version}
indexer_check=$(echo "$indexer" | sed -E "s/v[0-9]+/$version/")
echo "— Checking for [$indexer_check] != [$indexer] and $indexer_check exists"
if [ "$indexer_check" != "$indexer" ] && [ -f "$indexer_check" ]; then
echo "--- Found [v$i] indexer for [$indexer] - comparing to [$indexer_check]"
Expand All @@ -468,7 +468,7 @@ if [ -n "$newschema_indexers" ]; then
for ((i = max_schema; i >= min_schema; i--)); do
version="v$i"
echo "--- looking for [$version] indexer of [$indexer]"
indexer_check=${indexer/v[0-9]+/$version}
indexer_check=$(echo "$indexer" | sed -E "s/v[0-9]+/$version/")
if [ "$indexer_check" != "$indexer" ] && [ -f "$indexer_check" ]; then
echo "--- Found [v$i] indexer for [$indexer] - comparing to [$indexer_check]"
if $debug; then
Expand All @@ -490,7 +490,7 @@ if [ -n "$removed_indexers" ]; then
for indexer in ${removed_indexers}; do
echo "--- looking for previous versions of removed indexer [$indexer]"
for ((i = max_schema; i >= min_schema; i--)); do
indexer_remove=${indexer/v[0-9]+/v$i}
indexer_remove=$(echo "$indexer" | sed -E "s/v[0-9]+/$version/")
if [ "$indexer_remove" != "$indexer" ] && [ -f "$indexer_remove" ]; then
echo "--- Found [v$i] indexer for [$indexer] - removing [$indexer_remove]"
if $debug; then
Expand Down Expand Up @@ -568,13 +568,17 @@ while true; do
read -ep "Do you wish to Force Push with Lease [Ff] or Push branch [Pp] $push_branch to $prowlarr_remote_name? Enter any other key to exit: " -n1 push_choice
case $push_choice in
[Ff]*)
[[ $debug ]] && read -ep "Pausing for debugging - Press any key to continue or [Ctrl-C] to abort." -n1 -s
if $debug; then
read -ep "Pausing for debugging - Press any key to continue or [Ctrl-C] to abort." -n1 -s
fi
git push "$prowlarr_remote_name" "$push_branch" --force-if-includes --force-with-lease
echo "--- Branch Force Pushed"
exit 0
;;
[Pp]*)
[[ $debug ]] && read -ep "Pausing for debugging - Press any key to continue or [Ctrl-C] to abort." -n1 -s
if $debug; then
read -ep "Pausing for debugging - Press any key to continue or [Ctrl-C] to abort." -n1 -s
fi
git push "$prowlarr_remote_name" "$push_branch" --force-if-includes
echo "--- Branch Pushed"
exit 0
Expand Down

0 comments on commit c7ba65d

Please sign in to comment.