Skip to content

Instantly share code, notes, and snippets.

@moritztim
Created February 13, 2024 18:40
Show Gist options
  • Save moritztim/2ea5449cd5f7d140fe4e7e55fbbe3792 to your computer and use it in GitHub Desktop.
Save moritztim/2ea5449cd5f7d140fe4e7e55fbbe3792 to your computer and use it in GitHub Desktop.
Macos PKL Install
#!/bin/bash
tag="0.25.2"
# Identify CPU architecture
architecture="$(uname -m)"
if [ "$architecture" == "arm64" ] || [ "$architecture" == "aarch64" ]; then
build="aarch64"
elif [ "$architecture" == "x86_64" ]; then
if sysctl -n sysctl.proc_translated > /dev/null 2>&1; then
# This is an ARM CPU running in translation mode
build="aarch64"
else
build="amd64"
fi
else
echo "Couldn't identify CPU architecture."
exit 0
fi
curl -L -o /usr/local/bin/pkl https://github.com/apple/pkl/releases/download/$tag/pkl-macos-$build
chmod +x /usr/local/bin/pkl
pkl --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment