-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·33 lines (23 loc) · 962 Bytes
/
setup.sh
File metadata and controls
executable file
·33 lines (23 loc) · 962 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# Download CloudSync.xcframework for iOS if it doesn't exist
# This script is run during `yarn prepare`
set -e
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
IOS_DIR="$ROOT_DIR/ios"
XCFRAMEWORK_DIR="$IOS_DIR/CloudSync.xcframework"
# Read version from package.json
VERSION=$(node -p "require('$ROOT_DIR/package.json').version")
if [ -d "$XCFRAMEWORK_DIR" ]; then
echo "[sqlite-sync] CloudSync.xcframework already exists, skipping download"
exit 0
fi
echo "[sqlite-sync] Downloading CloudSync.xcframework v${VERSION}..."
# Create ios directory if it doesn't exist
mkdir -p "$IOS_DIR"
# Download and extract
DOWNLOAD_URL="https://github.com/sqliteai/sqlite-sync-dev/releases/download/${VERSION}/cloudsync-apple-xcframework-${VERSION}.zip"
TEMP_ZIP="$IOS_DIR/cloudsync.zip"
curl -L -o "$TEMP_ZIP" "$DOWNLOAD_URL"
unzip -o "$TEMP_ZIP" -d "$IOS_DIR"
rm "$TEMP_ZIP"
echo "[sqlite-sync] CloudSync.xcframework downloaded successfully"