Created
July 29, 2025 16:05
-
-
Save jb510/89c31a3f892d2415b3824b250e441e99 to your computer and use it in GitHub Desktop.
Revisions
-
jb510 revised this gist
Jul 29, 2025 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ #!/bin/bash set -e # After installing chmod +x update_freecad_weekly.sh # to run ./update_freecad_weekly.sh # === Configuration === PLATFORM="arm64" # Change this to "x86_64" for Intel Macs APP_NAME="FreeCAD.app" -
jb510 created this gist
Jul 29, 2025 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,48 @@ #!/bin/bash set -e # === Configuration === PLATFORM="arm64" # Change this to "x86_64" for Intel Macs APP_NAME="FreeCAD.app" INSTALL_PATH="/Applications/$APP_NAME" TMP_DIR="/tmp/freecad_update" RELEASES_URL="https://api.github.com/repos/FreeCAD/FreeCAD/releases" mkdir -p "$TMP_DIR" cd "$TMP_DIR" echo "π Fetching latest FreeCAD weekly release info for $PLATFORM..." DMG_INFO=$(curl -s "$RELEASES_URL" | jq -r --arg platform "$PLATFORM" ' [.[] | select(.tag_name | test("weekly"))][0].assets[] | select(.name | endswith(".dmg") and contains("macOS") and contains($platform)) | {name: .name, url: .browser_download_url} ') DMG_NAME=$(echo "$DMG_INFO" | jq -r '.name') DMG_URL=$(echo "$DMG_INFO" | jq -r '.url') if [[ -z "$DMG_URL" || "$DMG_URL" == "null" ]]; then echo "β Could not find a macOS .dmg for architecture: $PLATFORM" exit 1 fi echo "β Found .dmg: $DMG_NAME" echo "β¬οΈ Downloading from: $DMG_URL" curl -L "$DMG_URL" -o "$DMG_NAME" echo "π Mounting .dmg..." MOUNT_POINT=$(hdiutil attach "$DMG_NAME" | grep "/Volumes" | awk '{print $3}') echo "ποΈ Removing old FreeCAD (if it exists)..." if [ -d "$INSTALL_PATH" ]; then sudo rm -rf "$INSTALL_PATH" fi echo "π¦ Copying new FreeCAD to /Applications..." cp -R "$MOUNT_POINT/$APP_NAME" /Applications/ echo "βοΈ Ejecting volume..." hdiutil detach "$MOUNT_POINT" echo "β FreeCAD Weekly (standalone) has been installed to /Applications."