chore: 官网拆分 homepage + 关于页瘦身 + 端口 5175(当前可用状态基线)
This commit is contained in:
1 parent
5eb11826db
commit
be151cb68f
85 files changed
+4420
-1530
No files matched your search
@@ -0,0 +1,109 @@
|
||||
# sourced by scripts/run.sh — temp OpsxShell.app for Dock icon (icons/icon.icns)
|
||||
# shellcheck shell=bash
|
||||
|
||||
# .noindex:避免 Spotlight 把临时 Dock 壳当成可打开的历史 App
|
||||
GUI_APP_DIR="$SCRIPT_DIR/src-tauri/target/gui-app.noindex"
|
||||
GUI_APP="$GUI_APP_DIR/OpsxShell.app"
|
||||
ICONS_DIR="$SCRIPT_DIR/src-tauri/icons"
|
||||
REL_APP="$SCRIPT_DIR/src-tauri/target/release/bundle/macos/OpsxShell.app"
|
||||
[ -d "$REL_APP" ] || REL_APP="$SCRIPT_DIR/src-tauri/target/release/bundle/macos/OpsXShell.app"
|
||||
DBG_APP="$SCRIPT_DIR/src-tauri/target/debug/bundle/macos/OpsxShell.app"
|
||||
[ -d "$DBG_APP" ] || DBG_APP="$SCRIPT_DIR/src-tauri/target/debug/bundle/macos/OpsXShell.app"
|
||||
REL_BIN="$SCRIPT_DIR/src-tauri/target/release/OpsxShell"
|
||||
[ -x "$REL_BIN" ] || REL_BIN="$SCRIPT_DIR/src-tauri/target/release/OpsXShell"
|
||||
DBG_BIN_A="$SCRIPT_DIR/src-tauri/target/debug/OpsxShell"
|
||||
[ -x "$DBG_BIN_A" ] || DBG_BIN_A="$SCRIPT_DIR/src-tauri/target/debug/OpsXShell"
|
||||
DBG_BIN_B="$SCRIPT_DIR/src-tauri/target/debug/opsxshell"
|
||||
GUI_DEV_NEEDS_VITE=0
|
||||
|
||||
_gui_write_plist() {
|
||||
cat >"$GUI_APP/Contents/Info.plist" <<'PLIST'
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDisplayName</key><string>OpsxShell</string>
|
||||
<key>CFBundleExecutable</key><string>OpsxShell</string>
|
||||
<key>CFBundleIconFile</key><string>icon.icns</string>
|
||||
<key>CFBundleIdentifier</key><string>com.opsxshell.desktop.dev</string>
|
||||
<key>CFBundleName</key><string>OpsxShell</string>
|
||||
<key>CFBundlePackageType</key><string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key><string>2.1.1-dev</string>
|
||||
<key>CFBundleVersion</key><string>0</string>
|
||||
<key>LSHighResolutionCapable</key><true/>
|
||||
</dict>
|
||||
</plist>
|
||||
PLIST
|
||||
}
|
||||
|
||||
_gui_wrap_bin() {
|
||||
local src="$1"
|
||||
mkdir -p "$GUI_APP/Contents/MacOS" "$GUI_APP/Contents/Resources"
|
||||
cp "$src" "$GUI_APP/Contents/MacOS/OpsxShell"
|
||||
chmod +x "$GUI_APP/Contents/MacOS/OpsxShell"
|
||||
_gui_write_plist
|
||||
}
|
||||
|
||||
ensure_gui_dev_app() {
|
||||
local icon="$ICONS_DIR/icon.icns"
|
||||
GUI_DEV_NEEDS_VITE=0
|
||||
if [ ! -f "$icon" ]; then
|
||||
error "缺少 ${icon}"
|
||||
return 1
|
||||
fi
|
||||
mkdir -p "$GUI_APP_DIR"
|
||||
if [ -d "$DBG_APP" ]; then
|
||||
rm -rf "$GUI_APP"
|
||||
cp -R "$DBG_APP" "$GUI_APP"
|
||||
GUI_DEV_NEEDS_VITE=1
|
||||
elif [ -x "$DBG_BIN_A" ]; then
|
||||
rm -rf "$GUI_APP"
|
||||
_gui_wrap_bin "$DBG_BIN_A"
|
||||
GUI_DEV_NEEDS_VITE=1
|
||||
elif [ -x "$DBG_BIN_B" ]; then
|
||||
rm -rf "$GUI_APP"
|
||||
_gui_wrap_bin "$DBG_BIN_B"
|
||||
GUI_DEV_NEEDS_VITE=1
|
||||
elif [ -d "$REL_APP" ]; then
|
||||
rm -rf "$GUI_APP"
|
||||
cp -R "$REL_APP" "$GUI_APP"
|
||||
elif [ -x "$REL_BIN" ]; then
|
||||
rm -rf "$GUI_APP"
|
||||
_gui_wrap_bin "$REL_BIN"
|
||||
else
|
||||
error "没有可包装的桌面二进制。请先 ./run.sh gui 走一次 tauri 编译,或 npm run tauri -- build --no-bundle。"
|
||||
return 1
|
||||
fi
|
||||
mkdir -p "$GUI_APP/Contents/Resources"
|
||||
cp "$icon" "$GUI_APP/Contents/Resources/icon.icns"
|
||||
# 拷来的正式包可能仍叫 OpsXShell:统一成 OpsxShell(与 OpsxAPI / OpsxDB 同一套大小写)
|
||||
if [ -x "$GUI_APP/Contents/MacOS/OpsXShell" ] && [ ! -x "$GUI_APP/Contents/MacOS/OpsxShell" ]; then
|
||||
mv "$GUI_APP/Contents/MacOS/OpsXShell" "$GUI_APP/Contents/MacOS/OpsxShell"
|
||||
fi
|
||||
/usr/libexec/PlistBuddy -c "Set :CFBundleDisplayName OpsxShell" "$GUI_APP/Contents/Info.plist" 2>/dev/null || true
|
||||
/usr/libexec/PlistBuddy -c "Set :CFBundleName OpsxShell" "$GUI_APP/Contents/Info.plist" 2>/dev/null || true
|
||||
/usr/libexec/PlistBuddy -c "Set :CFBundleExecutable OpsxShell" "$GUI_APP/Contents/Info.plist" 2>/dev/null || true
|
||||
/usr/libexec/PlistBuddy -c "Set :CFBundleIconFile icon.icns" "$GUI_APP/Contents/Info.plist" 2>/dev/null || true
|
||||
/usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier com.opsxshell.desktop.dev" "$GUI_APP/Contents/Info.plist" 2>/dev/null || true
|
||||
local stamp
|
||||
stamp="$(date +%Y%m%d%H%M%S)"
|
||||
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${stamp}" "$GUI_APP/Contents/Info.plist" 2>/dev/null || true
|
||||
touch "$GUI_APP"
|
||||
success "临时 .app 已刷 icons/icon.icns → ${GUI_APP}"
|
||||
}
|
||||
|
||||
kill_opsxshell_gui() {
|
||||
stop_detached "$DESKTOP_LABEL"
|
||||
pkill -f "$SCRIPT_DIR/src-tauri/target/debug/opsxshell" 2>/dev/null || true
|
||||
pkill -f "$SCRIPT_DIR/src-tauri/target/debug/OpsXShell" 2>/dev/null || true
|
||||
pkill -f "$SCRIPT_DIR/src-tauri/target/debug/OpsxShell" 2>/dev/null || true
|
||||
pkill -f "$SCRIPT_DIR/node_modules/.bin/tauri" 2>/dev/null || true
|
||||
pkill -f "$GUI_APP" 2>/dev/null || true
|
||||
pkill -x OpsxShell 2>/dev/null || true
|
||||
pkill -x OpsXShell 2>/dev/null || true
|
||||
}
|
||||
|
||||
gui_is_running() {
|
||||
pgrep -f "$GUI_APP/Contents/MacOS/" >/dev/null 2>&1 \
|
||||
|| pgrep -x OpsxShell >/dev/null 2>&1
|
||||
}
|
||||
Reference in new issue
Block a user