From 18a94c8800ee80b782bd51b04a96b924fcdac6df Mon Sep 17 00:00:00 2001 From: Staubgeborener Date: Fri, 13 Sep 2024 09:11:48 +0200 Subject: [PATCH] Add check if github repo exists/is visible in debug output --- script.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/script.sh b/script.sh index 11fa1f4..9f48b99 100755 --- a/script.sh +++ b/script.sh @@ -93,6 +93,16 @@ if [ "$debug_output" = true ]; then fi done < $HOME/klipper-backup/.env end_debug_line + + if [[ $git_host == "github.com" ]]; then + begin_debug_line + if curl -fsS "https://api.github.com/repos/${github_username}/${github_repository}" >/dev/null; then + echo "The GitHub repo ${github_username}/${github_repository} exists (public)" + else + echo "Error: no GitHub repo ${github_username}/${github_repository} found (maybe private)" + fi + end_debug_line + fi fi # Check if backup folder exists, create one if it does not