Last active
April 14, 2026 03:16
-
-
Save alexandcote/edb74ad7d86820da6dca162fec30160c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [[ "$OSTYPE" == "linux-gnu"* ]]; then | |
| os=linux | |
| arch=amd64 | |
| elif [[ "$OSTYPE" == "darwin"* ]]; then | |
| os=macos | |
| if [[ $(uname -m) == "arm64" ]]; then | |
| arch=arm64 | |
| else | |
| arch=amd64 | |
| fi | |
| else | |
| echo "OS not supported" | |
| exit 1 | |
| fi | |
| asset="d-${os}-${arch}" | |
| sudo chown $USER /opt/d | |
| url=$(wget -q -nv -O- https://api.github.com/repos/alexandcote/d/releases/latest 2>/dev/null | jq -r ".assets[] | select(.browser_download_url | contains(\"${asset}\")) | .browser_download_url") | |
| sudo wget -q $url -P /opt/d/ | |
| sudo tar -xf /opt/d/${asset}.tar.gz -C /opt/d/ | |
| sudo rm -rf /opt/d/${asset}.tar.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment