Skip to content

Commit

Permalink
Add check if github repo exists/is visible in debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
Staubgeborener authored Sep 13, 2024
1 parent 87316c9 commit 18a94c8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 18a94c8

Please sign in to comment.