Skip to content

Commit

Permalink
Improve download-metal-cpp script
Browse files Browse the repository at this point in the history
  • Loading branch information
clebert committed Aug 25, 2023
1 parent 60f8988 commit 61079d0
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions download-metal-cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,23 @@ OS_VERSION="$OS_MAJOR_VERSION.$OS_MINOR_VERSION"

if [[ $OS_MAJOR_VERSION == "12" ]]
then
URL="https://developer.apple.com/metal/cpp/files/metal-cpp_macOS12_iOS15.zip"
ZIP_FILE_NAME="metal-cpp_macOS12_iOS15.zip"
elif [[ $OS_MAJOR_VERSION == "13" ]]
then
if [[ $OS_MINOR_VERSION -le 2 ]]
then
URL="https://developer.apple.com/metal/cpp/files/metal-cpp_macOS13_iOS16.zip"
ZIP_FILE_NAME="metal-cpp_macOS13_iOS16.zip"
else
URL="https://developer.apple.com/metal/cpp/files/metal-cpp_macOS13.3_iOS16.4.zip"
ZIP_FILE_NAME="metal-cpp_macOS13.3_iOS16.4.zip"
fi
elif [[ $OS_MAJOR_VERSION == "14" ]]
then
URL="https://developer.apple.com/metal/cpp/files/metal-cpp_macOS14_iOS17-beta.zip"
ZIP_FILE_NAME="metal-cpp_macOS14_iOS17-beta.zip"
else
echo "Unsupported macOS version: $OS_VERSION"
exit 1
fi

curl -LO $URL

ZIP_FILE_NAME=$(basename $URL)

unzip "$ZIP_FILE_NAME" -d .
rm "$ZIP_FILE_NAME"
curl -LO https://developer.apple.com/metal/cpp/files/$ZIP_FILE_NAME
unzip $ZIP_FILE_NAME -d .
rm $ZIP_FILE_NAME

0 comments on commit 61079d0

Please sign in to comment.