forked from sofintel/sofintel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-sofintel.sh
More file actions
executable file
·47 lines (36 loc) · 1.24 KB
/
Copy pathrun-sofintel.sh
File metadata and controls
executable file
·47 lines (36 loc) · 1.24 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# Run Sofintel with CEF support
# This script builds and runs Sofintel from the bundled .app to ensure CEF works correctly
set -euo pipefail
BUILD_TYPE="${1:-debug}"
CEF_PATH="${CEF_PATH:-$HOME/.local/share/cef}"
# Get architecture
version_info=$(rustc --version --verbose)
host_line=$(echo "$version_info" | grep host)
target_triple=${host_line#*: }
# Determine paths based on build type
if [[ "$BUILD_TYPE" == "release" ]]; then
TARGET_DIR="release"
BUILD_FLAG="--release"
else
TARGET_DIR="debug"
BUILD_FLAG=""
export CARGO_INCREMENTAL=true
fi
APP_PATH="target/${target_triple}/${TARGET_DIR}/bundle/Sofintel.app"
# Check if we need to rebuild/rebundle
NEEDS_BUNDLE=false
if [[ ! -d "$APP_PATH" ]]; then
NEEDS_BUNDLE=true
elif [[ ! -d "$APP_PATH/Contents/Frameworks/Chromium Embedded Framework.framework" ]]; then
NEEDS_BUNDLE=true
fi
if [[ "$NEEDS_BUNDLE" == "true" ]]; then
echo "Building and bundling Sofintel with CEF..."
./script/bundle-mac-cef "$BUILD_TYPE"
fi
# Set remote server path for development
export ZED_COPY_REMOTE_SERVER="$PWD/target/${target_triple}/${TARGET_DIR}/remote_server.gz"
# Run the bundled app
echo "Running Sofintel from: $APP_PATH"
exec "$APP_PATH/Contents/MacOS/Sofintel" "$@"