Skip to content

Commit 1eed71c

Browse files
author
Nosheen Adil
committed
add utils.sh
1 parent c1def9b commit 1eed71c

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

scripts/utils.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Detects if macOS
2+
isMac()
3+
{
4+
[ "$(uname)" == "Darwin" ]
5+
}
6+
7+
# Detects if Linux OS
8+
isLinux()
9+
{
10+
[ "$(expr substr $(uname -s) 1 5)" == "Linux" ]
11+
}
12+
13+
# Detects if Ubuntu OS
14+
isUbuntu()
15+
{
16+
[ "$(expr substr $(awk -F= '/^NAME/{print $2}' /etc/os-release) 2 6)" == "Ubuntu" ]
17+
}
18+
19+
# Detects if Windows OS
20+
isWin()
21+
{
22+
[ "$(expr substr $(uname) 1 5)" == "MINGW" ]
23+
}
24+
25+
# Detects if arm architecture
26+
isArm()
27+
{
28+
[ "$(arch)" == "aarch64" ]
29+
}

0 commit comments

Comments
 (0)