VoyagerXHF's picture
Upload folder using huggingface_hub (part 5)
3fbbdd9 verified
Raw History Blame Contribute Delete
1.52 kB
#!/usr/bin/env bash
#
# Launch the Logseq desktop app.
#
# Locates the built Logseq.app relative to this script (no absolute paths) and
# opens it. Works standalone -- build.sh does not need to have been sourced.
#
# Search order:
# 1. $APP_OUTPUT_DIR/Logseq.app (if APP_OUTPUT_DIR is set)
# 2. <script dir>/Logseq.app (default build.sh output copy)
# 3. <script dir>/static/out/Logseq-darwin-*/Logseq.app (electron-forge output)
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
find_app() {
local candidates=()
if [ -n "${APP_OUTPUT_DIR:-}" ]; then
candidates+=("$APP_OUTPUT_DIR/Logseq.app")
fi
candidates+=("$SCRIPT_DIR/Logseq.app")
local c
for c in "${candidates[@]}"; do
if [ -d "$c" ]; then
printf '%s\n' "$c"
return 0
fi
done
# Fall back to the electron-forge output directory (any arch).
local found
found="$(find "$SCRIPT_DIR/static/out" -maxdepth 2 -name 'Logseq.app' -type d 2>/dev/null | head -1 || true)"
if [ -n "$found" ]; then
printf '%s\n' "$found"
return 0
fi
return 1
}
APP_PATH="$(find_app || true)"
if [ -z "${APP_PATH:-}" ] || [ ! -d "$APP_PATH" ]; then
echo "ERROR: Could not find Logseq.app. Run build.sh first." >&2
exit 1
fi
echo "Launching: $APP_PATH"
# Electron bundles everything it needs, so no DYLD_/QT_ environment is required.
# Use `open -W` so the script tracks the app's lifetime; pass through any args.
exec open -W "$APP_PATH" --args --force-renderer-accessibility "$@"