Skip to content

Commit

Permalink
add OS check for root endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
amenocal committed Mar 29, 2024
1 parent 8d450b7 commit 8ecdb1e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gh-repo-stats
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,13 @@ CheckAdminRights() {
################################################################################
#### Function isGHEC ###########################################################
isCloud() {
ROOT_DATA=$(gh api //)
if [[ "$OSTYPE" == "msys" ]]; then
# If the operating system is Windows escape leading slash
ROOT_DATA=$(gh api //)
else
# If the operating system is Unix-like (e.g., Linux, macOS)
ROOT_DATA=$(gh api /)
fi
USER_URL=$(echo -n "${ROOT_DATA}" | jq -r '.current_user_url')

if [[ "${USER_URL}" != "https://api.github.com/user" ]]; then
Expand Down

0 comments on commit 8ecdb1e

Please sign in to comment.