-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathlaunch-devtools.sh
More file actions
executable file
·44 lines (37 loc) · 1.41 KB
/
launch-devtools.sh
File metadata and controls
executable file
·44 lines (37 loc) · 1.41 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
#!/bin/bash
# Launcher with DevTools enabled for debugging
set -o pipefail
# Change to script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
# Resolve electron binary: prefer system electron + local .asar-cache, fall back to AppImage
if command -v electron >/dev/null 2>&1; then
ELECTRON_BIN="$(command -v electron)"
ASAR_FILE=".asar-cache/app.asar"
elif [[ -x "./squashfs-root/usr/lib/node_modules/electron/dist/electron" ]]; then
ELECTRON_BIN="./squashfs-root/usr/lib/node_modules/electron/dist/electron"
ASAR_FILE="squashfs-root/usr/lib/node_modules/electron/dist/resources/app.asar"
else
echo "ERROR: No electron binary found. Install electron or place an AppImage in squashfs-root/"
exit 1
fi
# Enable logging and DevTools
export ELECTRON_ENABLE_LOGGING=1
export CLAUDE_ENABLE_LOGGING=1
STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
LOG_DIR="${CLAUDE_LOG_DIR:-$STATE_HOME/claude-cowork/logs}"
export CLAUDE_LOG_DIR="$LOG_DIR"
# Wayland support
if [[ -n "$WAYLAND_DISPLAY" ]] || [[ "$XDG_SESSION_TYPE" == "wayland" ]]; then
export ELECTRON_OZONE_PLATFORM_HINT=wayland
echo "Wayland detected, using Ozone platform"
fi
# Create log directory
mkdir -p "$LOG_DIR"
# Launch with DevTools (--inspect enables Node.js inspector)
"$ELECTRON_BIN" \
"./${ASAR_FILE}" \
--no-sandbox \
--disable-gpu \
--inspect "$@" 2>&1 | tee -a "$LOG_DIR/startup.log"
exit "${PIPESTATUS[0]}"