Skip to content

Commit

Permalink
add utils.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Nosheen Adil committed Nov 13, 2024
1 parent c1def9b commit 1eed71c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions scripts/utils.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Detects if macOS
isMac()
{
[ "$(uname)" == "Darwin" ]
}

# Detects if Linux OS
isLinux()
{
[ "$(expr substr $(uname -s) 1 5)" == "Linux" ]
}

# Detects if Ubuntu OS
isUbuntu()
{
[ "$(expr substr $(awk -F= '/^NAME/{print $2}' /etc/os-release) 2 6)" == "Ubuntu" ]
}

# Detects if Windows OS
isWin()
{
[ "$(expr substr $(uname) 1 5)" == "MINGW" ]
}

# Detects if arm architecture
isArm()
{
[ "$(arch)" == "aarch64" ]
}

0 comments on commit 1eed71c

Please sign in to comment.