Skip to content

Releases: dacj4n/envSwitch

envSwitch v0.2.3

Choose a tag to compare

@dacj4n dacj4n released this 03 Jun 08:05

v0.2.3 (2026-06-03)

Changed — Remove JAVA_HOME from JDK module

  • JDK no longer exports JAVA_HOME environment variable. Binary routing is handled entirely by shims + PATH.
  • Removed the JDK-specific home directory override in cover() — the find_jdk_home() function was correctly resolving Contents/Home for .jdk bundle layouts (used by Zulu and Temurin tar archives), but JAVA_HOME was always set to the raw install_path, causing a mismatch.
  • JDK env_vars is now empty. Shims directory handles all binary resolution.

Changed — GUI log display refinements

  • Operation log now displays newest first (reversed order), so the latest entries are always visible without scrolling.

  • Added Clear button to the Logs page: clears the operation log file and immediately refreshes the UI. Uses clear_ops() backend function with Result<String, String> return for Tauri IPC compatibility.

  • Version bump: 0.2.2 → 0.2.3.


v0.2.3 (2026-06-03)

变更 — 移除 JAVA_HOME 环境变量切换

  • JDK 模块不再导出 JAVA_HOME 环境变量,二进制路由完全由 shims + PATH 处理。
  • 移除了 cover() 中的 JDK 主目录覆盖逻辑 — find_jdk_home() 已能正确解析 .jdk bundle(Zulu 和 Temurin tar 包常用)中的 Contents/Home,但之前 JAVA_HOME 始终被设为原始 install_path,导致路径不匹配。
  • JDK 的 env_vars 已设为空,所有二进制解析通过 shims 目录完成。

变更 — GUI 日志显示优化

  • 操作日志现在从上到下由新到旧排列,无需滚动即可看到最新条目。

  • 日志页面新增清空按钮:清除操作日志文件并立即刷新界面。使用 clear_ops() 后端函数,返回 Result<String, String> 确保 Tauri IPC 兼容。

  • 版本号:0.2.2 → 0.2.3。

Full Changelog: v0.2.2...v0.2.3

envSwitch v0.2.2

Choose a tag to compare

@dacj4n dacj4n released this 21 May 09:13

v0.2.2 (2026-05-21)

Added — GUI one-click shell init/uninit

  • Settings page now has Initialize and Remove buttons for shell integration.
  • init_shell / uninit_shell Tauri commands: create ~/.envswitch/ dirs, write init.sh, add/remove init block from .zshrc/.bashrc — all from the GUI, no CLI binary needed.
  • Shell integration status shown in real-time on the Settings page.

Changed — CLI availability is optional

  • cover_module no longer requires the CLI binary to be installed. Only shell initialization is checked.
  • Doctor page: CLI availability downgraded from error to warning, labeled "(optional — for terminal use)".

Added — Python unversioned tool symlinks (pip, pydoc, idle, wheel)

  • Homebrew python@X.Y is keg-only — unversioned pip3/pip/pydoc3/idle3 etc. were missing.
  • ensure_symlink() helper creates convenience links after install: python3, python, pip3, pip, pydoc3, idle3, python3-config, wheel3.

Changed — CI: Intel Mac build target

  • Release workflow now builds both aarch64-apple-darwin (Apple Silicon) and x86_64-apple-darwin (Intel Mac).
  • SHA256 printed to CI logs for audit trail.

v0.2.2 (2026-05-21)

新增 — GUI 一键 Shell 初始化/移除

  • 设置页面新增 初始化 和 移除 按钮,一键管理 Shell 集成。
  • init_shell / uninit_shell Tauri 命令:创建 ~/.envswitch/ 目录、写入 init.sh、添加/移除 rc 文件中的 init block — 全部在 GUI 内完成,无需 CLI 二进制。
  • 设置页面实时显示 Shell 集成状态。

变更 — CLI 可用性改为可选

  • cover_module 不再要求 CLI 二进制必须安装,仅检查 Shell 初始化。
  • 诊断页面:CLI 可用性从错误降级为警告,标注"可选 — 终端使用"。

新增 — Python 非版本化工具链接(pip、pydoc、idle、wheel)

  • Homebrew 的 python@X.Y 是 keg-only,缺少 pip3/pip/pydoc3/idle3 等非版本化链接。
  • ensure_symlink() 辅助函数在安装后创建便捷链接:python3、python、pip3、pip、pydoc3、idle3、python3-config、wheel3。

变更 — CI:Intel Mac 构建目标

  • Release 工作流现在同时构建 aarch64-apple-darwin(Apple Silicon)和 x86_64-apple-darwin(Intel Mac)。
  • CI 日志中打印 SHA256 便于审计。

Full Changelog: v0.2.1...v0.2.2

envSwitch v0.2.1

Choose a tag to compare

@dacj4n dacj4n released this 20 May 02:46

v0.2.1 (2026-05-20)

Changed — GUI app name to envSwitch

  • GUI app bundle product name changed from lowercase envswitch to camelCase envSwitch. CLI binary name remains envswitch.
  • Version bump: 0.2.0 → 0.2.1.

Added — sanitize_cmd() for service subprocess reliability

  • New helper sanitize_cmd() in providers/homebrew.rs: clears inherited environment and sets only PATH + HOME + LANG=C + LC_ALL=C + LC_CTYPE=C.
  • Applied to all service subprocesses: MySQL (mysqld init + start) and PostgreSQL (initdb + pg_ctl).
  • Guarantees reliable startup from any context (CLI, GUI, launchd, SSH) — C locale is always available on all Unix systems.

Fixed — PostgreSQL GUI startup

  • init_data_dir was calling Command::new("initdb") without a full path. Now uses find_binary(install_path, "initdb").
  • start_service: clean stale postmaster.pid before starting, detect already-running PostgreSQL, redirect pg_ctl stdout/stderr to log file, wait 2s and verify pg_ctl exit status, confirm postgres PID is alive, return last 20 log lines on failure.
  • Set LC_ALL=C to fix FATAL: postmaster became multithreaded during startup when launched from macOS GUI.

Fixed — GUI page state lost on navigation

  • Pages were unmounting on sidebar navigation, losing spinner states, expanded sections, and scroll positions.
  • Added KeepAlive wrapper that keeps all main pages mounted and uses display: none for inactive ones, with lazy first-mount via useRef.
  • Added usePageActive(path, fn) hook — each page auto-refreshes data when navigated to (Services, Versions, Status, Logs, Doctor).

Fixed — Services page simultaneous spinners

  • toggling state changed from string | null to Set<string> so multiple services can show spinners concurrently on Start All / Stop All.

Docs

  • Added screenshots section to both English and Chinese READMEs.

v0.2.1 (2026-05-20)

变更 — GUI 应用名称改为 envSwitch

  • GUI app bundle 的 productName 从小写 envswitch 改为 camelCase envSwitch。CLI 二进制名仍为 envswitch。
  • 版本号:0.2.0 → 0.2.1。

新增 — sanitize_cmd() 服务进程环境净化

  • 新增 sanitize_cmd() 辅助函数(位于 providers/homebrew.rs):清空继承的环境变量,只保留 PATH + HOME + LANG=C + LC_ALL=C + LC_CTYPE=C。
  • 应用到所有服务子进程:MySQL(mysqld 初始化/启动)和 PostgreSQL(initdb/pg_ctl)。
  • 保证从任何上下文(终端、GUI、launchd、SSH)都能稳定启动 — C locale 在所有 Unix 系统上始终存在。

修复 — PostgreSQL GUI 启动

  • init_data_dir 改用 find_binary(install_path, "initdb") 解析完整路径,不再依赖 PATH。
  • start_service:启动前清理残留 postmaster.pid、检测已运行实例、将 pg_ctl 输出重定向到日志、等待 2 秒后验证退出状态、确认 postgres PID 存活、失败时返回最后 20 行日志。
  • 设置 LC_ALL=C 修复从 macOS GUI 启动时的 FATAL: postmaster became multithreaded during startup 错误。

修复 — GUI 页面导航后状态丢失

  • 侧边栏切换时页面组件被卸载,导致转圈状态、展开列表、滚动位置等丢失。
  • 新增 KeepAlive 组件,保持所有主页面挂载,非活跃页面用 display: none 隐藏,首次访问懒挂载。
  • 新增 usePageActive(path, fn) hook,每个页面在导航到时自动刷新数据(Services、Versions、Status、Logs、Doctor)。

修复 — 服务页面多服务同时转圈

  • toggling 状态从单个字符串改为 Set<string>,点击"全部启动/停止"时多个服务可同时显示转圈。

文档

  • 英文和中文 README 新增截图章节。

Full Changelog: v0.2.0...v0.2.1

Full Changelog: v0.2.0...v0.2.1

envSwitch v0.2.0

Choose a tag to compare

@dacj4n dacj4n released this 19 May 03:11

v0.2.0 (2026-05-19)

Changed — Brew modules: single opt symlink, no version-rename

  • All Homebrew-based modules (mysql, pgsql, php, python) now create a single symlink from ~/.envswitch/envs/<module>/<runtime_key> → /opt/homebrew/opt/<formula> instead of per-directory symlinks (bin, lib, share, etc.).
  • The directory name is the short runtime key (e.g., 8.0, 16, 3.11), not the full brew version. The actual version from brew is stored in metadata for display.
  • Removed the rename-to-actual-version logic in install_to that was creating duplicate directories (8.0/ and 8.0.46/).
  • Eliminates 60+ lines of duplicate rename code per brew module.

Added — source field in InstalledVersion

  • New source field: brew, tarball, system, fnm, nvm, custom, unknown.
  • sync_local now writes metadata with proper source label for every linked module.
  • list_installed matches metadata by install_path instead of version string for reliability.

Added — GUI: version labels + uninstall protection

  • version_labels: When the actual brew version differs from the runtime key (e.g., dir 3.11 → brew 3.11.15), the minor version is displayed next to the module name.
  • uninstallable: System/fnm/nvm modules no longer show the uninstall button (previously shown but ineffective).
  • source_paths: Non-brew modules now resolve bin/ symlinks to show the real source path (e.g., /usr/bin/ for system Python).

Fixed — MySQL service startup

  • sbin added to install symlink directories (mysqld lives in sbin/ on Homebrew).
  • Before starting, stale mysqld processes are killed and /tmp/mysql.sock + /tmp/mysqlx.sock are cleaned.
  • MySQL stderr is redirected to the log file instead of /dev/null.
  • After spawning, wait 2s and verify process is still alive; if it exited, return the last 20 log lines in the error message.
  • X Plugin disabled (--mysqlx=0) to prevent /tmp/mysqlx.sock conflicts.

Fixed — Python cover not working

  • Homebrew python@X.Y is keg-only and does not create python3/python symlinks.
  • Added post-install step to create python3 → python3.X and python → python3 convenience symlinks in the brew opt prefix, so shims can resolve unversioned commands.

Fixed — GUI Doctor diagnostics

  • Doctor page now includes two new checks: CLI binary available (searches PATH) and shell integration initialized (checks rc files).
  • CLI path uses which envswitch-equivalent PATH search + common locations, not the GUI app bundle path.

v0.2.0 (2026-05-19)

变更 — Brew 模块:单 opt symlink,取消版本重命名

  • 所有 Homebrew 模块(mysql、pgsql、php、python)现在创建单个 symlink:~/.envswitch/envs/<模块>/<runtime_key> → /opt/homebrew/opt/<formula>,替代之前的逐目录 symlink(bin、lib、share 等)。
  • 目录名使用短版本号(如 8.0、16、3.11),brew 的实际版本存储在 metadata 中用于展示。
  • 移除 install_to 中重命名到实际版本的逻辑,消除了 8.0/ 和 8.0.46/ 重复目录的问题。
  • 每个 brew 模块减少 60+ 行重复的重命名代码。

新增 — InstalledVersion 增加 source 字段

  • 新增 source 字段:brew、tarball、system、fnm、nvm、custom、unknown。
  • sync_local 现在为每个链接的模块写入带有正确 source 标签的 metadata。
  • list_installed 改为按 install_path 匹配 metadata,不再按 version 字符串。

新增 — GUI:版本标签 + 卸载保护

  • version_labels:当 brew 实际版本与 runtime key 不同时(如目录 3.11 → brew 3.11.15),在模块名旁显示小版本号。
  • uninstallable:系统/fnm/nvm 模块不再显示卸载按钮(之前显示但无效)。
  • source_paths:非 brew 模块现在解析 bin/ 下的 symlink 显示真实来源路径(如系统 Python 显示 /usr/bin/)。

修复 — MySQL 服务启动

  • 安装 symlink 目录增加 sbin(Homebrew 的 mysqld 位于 sbin/)。
  • 启动前清理残留 mysqld 进程和 /tmp/mysql.sock、/tmp/mysqlx.sock 文件。
  • MySQL stderr 重定向到日志文件,不再丢弃。
  • spawn 后等待 2 秒检查进程是否存活;如果退出,返回最后 20 行日志。
  • 禁用 X Plugin(--mysqlx=0)防止 /tmp/mysqlx.sock 冲突。

修复 — Python cover 不生效

  • Homebrew 的 python@X.Y 是 keg-only 的,不会创建 python3/python 符号链接。
  • 安装后自动在 brew opt prefix 中创建 python3 → python3.X 和 python → python3 便捷链接,使 shims 能解析无版本号命令。

修复 — GUI 诊断增强

  • 诊断页面新增两项检查:CLI 二进制可用(搜索 PATH)和 Shell 集成已初始化(检查 rc 文件)。
  • CLI 路径使用类 which envswitch 的 PATH 搜索 + 常见位置,不再显示 GUI app bundle 路径。

Full Changelog: v0.1.3...v0.2.0

envSwitch v0.1.3

Choose a tag to compare

@dacj4n dacj4n released this 18 May 09:54

v0.1.3 (2026-05-18)

Changed — Architecture: shell function → precmd hook + env.sh

Removed the envswitch() shell function wrapper entirely and replaced it with a clean precmd hook architecture:

  • cover / uncover / auto no longer output export statements to stdout. They write ~/.envswitch/state/env.sh instead.
  • Shell init block now uses a precmd hook (zsh) / PROMPT_COMMAND (bash) that sources env.sh on every prompt.
  • Environment variables (JAVA_HOME, GOROOT, etc.) refresh automatically on the next prompt after a cover operation.
  • which envswitch now returns only the binary path — no more shell function pollution.
  • envswitch init writes .zshrc/.bashrc for new terminals, and prints a hint to source ~/.envswitch/init.sh for immediate effect in the current terminal.
  • envswitch uninit removes the init block and prints cleanup instructions for the current shell session.
  • load-globals is no longer called by the init block (replaced by direct source env.sh at startup).

Added — GUI: CLI init detection + Doctor diagnostics

  • cover_module now checks that the envSwitch CLI binary is available (via PATH search) and that shell integration is initialized before allowing cover operations. If not, a clear error message is shown.
  • Doctor page adds two new diagnostic checks:
    • envSwitch CLI available — verifies the CLI binary exists in PATH (not the GUI app bundle).
    • Shell integration initialized — checks .zshrc/.bashrc for the init block.

Fixed — CLI path detection

  • check_init_status() now finds the real CLI binary by searching PATH (equivalent to which envswitch) and common install locations (~/.cargo/bin/, /usr/local/bin/, /opt/homebrew/bin/), instead of returning the GUI app bundle path.

Fixed — Build warnings

  • Suppressed dead_code warnings on library items that are consumed by the GUI crate but unreferenced by the CLI binary target.

v0.1.3 (2026-05-18)

变更 — 架构重构:shell function → precmd hook + env.sh

彻底移除 envswitch() shell function 包装,改为干净的 precmd hook 架构:

  • cover / uncover / auto 不再向 stdout 输出 export 语句,改为写入 ~/.envswitch/state/env.sh。
  • Shell init block 使用 precmd hook(zsh)/ PROMPT_COMMAND(bash),在每个提示符自动 source env.sh。
  • JAVA_HOME、GOROOT 等环境变量在 cover 操作后的下一次提示符自动刷新。
  • which envswitch 现在只返回 binary 路径 — 不再有 shell function 污染。
  • envswitch init 为新终端写入 .zshrc/.bashrc,并提示 source ~/.envswitch/init.sh 使当前终端立即生效。
  • envswitch uninit 移除 init block 并打印当前 shell 会话清理指令。
  • load-globals 不再被 init block 调用(改为启动时直接 source env.sh)。

新增 — GUI:CLI 初始化检测 + 诊断增强

  • cover_module 在允许 cover 操作前检查 envSwitch CLI 二进制是否可用(通过 PATH 搜索)以及 Shell 集成是否已初始化。未初始化时显示明确错误提示。
  • 诊断页面新增两项检查:
    • envSwitch 命令行可用 — 验证 CLI 二进制在 PATH 中存在(而非 GUI app bundle 路径)。
    • Shell 集成已初始化 — 检查 .zshrc/.bashrc 中的 init block。

修复 — CLI 路径检测

  • check_init_status() 现在通过搜索 PATH(等同于 which envswitch)和常见安装位置(~/.cargo/bin/、/usr/local/bin/、/opt/homebrew/bin/)来查找真正的 CLI 二进制,而非返回 GUI app bundle 路径。

修复 — 编译警告

  • 对仅被 GUI crate 引用、未被 CLI binary target 使用的库项添加了 #[allow(dead_code)],消除编译警告。

Full Changelog: v0.1.2...v0.1.3

envSwitch v0.1.2

Choose a tag to compare

@dacj4n dacj4n released this 18 May 06:35
style: fix cargo fmt alignment in homebrew.rs and php.rs

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

envSwitch v0.1.0

Choose a tag to compare

@dacj4n dacj4n released this 17 May 10:35