-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·41 lines (33 loc) · 1.26 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·41 lines (33 loc) · 1.26 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
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DESKTOP_DIR="$ROOT_DIR/desktop"
TAURI_DIR="$DESKTOP_DIR/src-tauri"
cd "$ROOT_DIR"
if [[ "${1:-}" == "--clean" ]]; then
echo "Cleaning desktop Tauri build output..."
cargo clean --manifest-path "$TAURI_DIR/Cargo.toml"
rm -rf "$TAURI_DIR/target/release/bundle" "$TAURI_DIR/target"/*/release/bundle 2>/dev/null || true
fi
if [[ ! -d "$DESKTOP_DIR/node_modules" ]]; then
(cd "$DESKTOP_DIR" && npm install)
fi
BUILD_ARGS=(build --config '{"bundle":{"createUpdaterArtifacts":false}}')
if [[ -n "${TAURI_TARGET:-}" ]]; then
BUILD_ARGS+=(--target "$TAURI_TARGET")
fi
if ! (cd "$DESKTOP_DIR" && npm exec -- tauri "${BUILD_ARGS[@]}"); then
if [[ "$(uname -s)" == "Darwin" ]]; then
echo "Tauri packaging failed; attempting simple DMG fallback from the built .app..."
"$ROOT_DIR/scripts/create-desktop-dmg.sh"
else
exit 1
fi
fi
if [[ "$(uname -s)" == "Darwin" ]]; then
find "$TAURI_DIR/target" -type f \( -name "*.dmg" -o -name "*.app.tar.gz" -o -name "*.sig" \) -print0 2>/dev/null \
| xargs -0 -I{} xattr -c "{}" 2>/dev/null || true
fi
echo
echo "Built desktop artifacts:"
find "$TAURI_DIR/target" -path "*/release/bundle/*" -type f -print 2>/dev/null | sort