Skip to content

Commit

Permalink
switch case for mac
Browse files Browse the repository at this point in the history
  • Loading branch information
DvirDukhan committed Sep 26, 2023
1 parent a9c9b25 commit a251062
Showing 1 changed file with 25 additions and 16 deletions.
41 changes: 25 additions & 16 deletions zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,33 @@ else
fi
echo $OS_NICK


declare -A archs=(
["x86_64"]="x86_64"
["aarch64"]="arm64v8"
["arm64v8"]="arm64v8"
)

# Get OS nick name
if [[ $os = 'macos' ]]
then
declare -A MACOS_OSNICKS=(
["13"]="ventura"
["12"]="monterey"
)
OS_NICK=${MACOS_OSNICKS[$OS_NICK]}
# Since macos uses bash v3, we cannot use associative arrays
case $OS_NICK in
12)
OS_NICK="monterey"
;;
13)
OS_NICK="ventura"
;;
*)
echo "Unknown MacOS version $OS_NICK"
exit 1
;;
esac
case $arch in
x86_64)
arch="x86_64"
;;
aarch64)
arch="arm64v8"
;;
*)
echo "Unknown MacOS architecture $arch"
exit 1
;;
esac
else
declare -A LINUX_OSNICKS=(
["rocky_linux8.8"]="rhel8"
Expand All @@ -54,9 +66,6 @@ else
OS_NICK=${LINUX_OSNICKS[$OS_NICK]}
fi
echo $OS_NICK

# Get architecture
arch=${archs[$arch]}
echo $arch

# Call zip and create the zip file
Expand Down

0 comments on commit a251062

Please sign in to comment.