Skip to content

Commit

Permalink
script: add argument debug logging and improve push logging
Browse files Browse the repository at this point in the history
  • Loading branch information
bakerboy448 committed Jun 28, 2024
1 parent 6752fd7 commit 2194c14
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion scripts/indexer-sync-v2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,15 @@ while getopts ":r:b:m:p:c:u:j:R:J:n:" opt; do
case ${opt} in
r )
prowlarr_remote_name=$OPTARG
log "DEBUG" "prowlarr_remote_name using argument $prowlarr_remote_name"
;;
b )
prowlarr_target_branch=$OPTARG
log "DEBUG" "prowlarr_target_branch using argument $prowlarr_target_branch"
;;
m )
mode_choice=$OPTARG
log "DEBUG" "mode_choice using argument $mode_choice"
case "$mode_choice" in
normal|n|N)
is_dev_exec=false
Expand All @@ -137,24 +140,31 @@ while getopts ":r:b:m:p:c:u:j:R:J:n:" opt; do
;;
p )
push_mode=$OPTARG
log "DEBUG" "push_mode using argument $push_mode"
;;
c )
PROWLARR_COMMIT_TEMPLATE=$OPTARG
log "DEBUG" "PROWLARR_COMMIT_TEMPLATE using argument $PROWLARR_COMMIT_TEMPLATE"
;;
u )
PROWLARR_REPO_URL=$OPTARG
log "DEBUG" "PROWLARR_REPO_URL using argument $PROWLARR_REPO_URL"
;;
j )
JACKETT_REPO_URL=$OPTARG
log "DEBUG" "JACKETT_REPO_URL using argument $JACKETT_REPO_URL"
;;
R )
PROWLARR_RELEASE_BRANCH=$OPTARG
log "DEBUG" "PROWLARR_RELEASE_BRANCH using argument $PROWLARR_RELEASE_BRANCH"
;;
J )
JACKETT_BRANCH=$OPTARG
log "DEBUG" "JACKETT_BRANCH using argument $JACKETT_BRANCH"
;;
n )
JACKETT_REMOTE_NAME=$OPTARG
log "DEBUG" "JACKETT_REMOTE_NAME using argument $JACKETT_REMOTE_NAME"
;;
\? )
usage
Expand Down Expand Up @@ -537,6 +547,7 @@ cleanup_and_commit() {

push_changes() {
push_branch="$prowlarr_target_branch"
log "INFO" "Pushing Changes to $push_branch as specified by push mode $push_mode"
case "$push_mode" in
force)
git push "$prowlarr_remote_name" "$push_branch" --force-if-includes --force-with-lease
Expand All @@ -547,7 +558,7 @@ push_changes() {
log "INFO" "Branch Pushed"
;;
skip|none|nopush|no)
log "INFO" "Skipping Push due to [skip|nopush|none] value"
log "INFO" "Skipping Push due to [skip|nopush|none|no] value"
;;
*)
log "INFO" "Invalid push mode specified ($push_mode). Exiting."
Expand Down

0 comments on commit 2194c14

Please sign in to comment.