visionA/local-tool/visiona-local/platform_linux.go
jim800121chen 8e7b6ae435 feat(local-tool): clean build 為預設 + 藏 server 小黑窗 + 預設真實模式
Makefile:
- 新增 clean-all target:clean + wails build/ + frontend build/ + server embed
- 新增 clean-build-exe / clean-build-dmg / clean-build-appimage

bootstrap-windows.ps1:
- 預設改為 clean build(每次重做 wails + server binary + frontend embed)
- 保留 vendor/ 快取避免重下 200MB+ 第三方相依
- 需要 fast path(只重跑 iscc)時設 VISIONA_FAST=1

app.go:
- configureSysProcAttr() 注入子行程,Windows 下 CREATE_NO_WINDOW 藏掉 server 小黑窗
- 覆蓋 server spawn / tar 解壓 / venv 建立 / pip install 四個關鍵點
- mockMode 預設改 false(依使用者決策 Q8,預設走真實硬體模式)
  需要強制 mock 時設環境變數 VISIONA_MOCK=1

platform_{windows,darwin,linux}.go:
- 新增 configureSysProcAttr(cmd):Windows 設 HideWindow + CREATE_NO_WINDOW,
  macOS/Linux 空實作

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 04:25:09 +08:00

23 lines
537 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//go:build linux
package main
import (
"os"
"os/exec"
"path/filepath"
)
// configureSysProcAttr 在 Linux 上不需要特殊設定。
func configureSysProcAttr(_ *exec.Cmd) {}
// platformDataDir 回傳 Linux 的應用程式資料目錄(遵循 XDG
// $XDG_DATA_HOME/visiona-local 或 ~/.local/share/visiona-local
func platformDataDir() string {
if xdg := os.Getenv("XDG_DATA_HOME"); xdg != "" {
return filepath.Join(xdg, appName)
}
home, _ := os.UserHomeDir()
return filepath.Join(home, ".local", "share", appName)
}