Skip to content

Releases: Geekstrange/Unbox

v0.0.7 Expanded

18 May 02:44
v0.0.7
bbca311

Choose a tag to compare

v0.0.7

✨ 新特性

  • 扩展支持格式与解压行为改进:移除 CLI 验证阶段的硬编码格式白名单,将格式判断完全交由 7z 后端决定,不再仅靠扩展名拦截。新增 tar.zst / tzst 在解压与压缩中的完整支持。扩充 isCompressedFile 启发式检测名单,涵盖 cabisoarjlzhcpiorpmdebdmgwimvhdzst,提升嵌套压缩包识别能力。解压时自动创建以压缩包命名的子目录,避免解压内容散落在当前目录。

  • 更新树形视图样式:将树形输出中的 └── 替换为 ╰─├── 替换为 ├─,并使用灰色(ANSI 90)渲染树形符号。分隔线由 === 改为 ---,界面更显圆润沉稳。

🐛 修复

  • 响应 SIGINT/SIGTERM 重置终端颜色:增加信号处理器,在收到 Ctrl+C 等中断信号时主动输出 ANSI 颜色重置码,避免终端颜色被“卡”在异常状态。

v0.0.7

✨ Features

  • Expanded format support & extraction behavior – Removed hardcoded format whitelist from CLI validation; now lets 7z decide compatibility instead of gating by extension. Added tar.zst / tzst support to both extractArchive and compressArchive. Extended isCompressedFile heuristic with cab, iso, arj, lzh, cpio, rpm, deb, dmg, wim, vhd, zst for better nested archive detection. Extraction now creates a subdirectory named after the archive, avoiding pollution of the current directory.

  • Updated tree view styling – Replaced └── with ╰─ and ├── with ├─; tree-drawing characters are now rendered in gray (ANSI 90). Separator lines changed from === to --- for a cleaner, rounded look.

🐛 Fixes

  • Reset terminal colors on SIGINT/SIGTERM – Added a signal handler that prints an ANSI reset code before exiting, preventing stuck color states when interrupted with Ctrl+C.

v0.0.6 reforge

09 Apr 08:33

Choose a tag to compare

代号释义:“Reforge”意为重铸、锻造新生。本次重构将零散的旧逻辑熔炼为一套统一的解析引擎,并统一解压后端,修复多个关键问题。

变更日志

🔧 重构

  • 统一树状解析引擎:移除冗余的 listDirlistInTemp 函数,新增 buildArchiveTree-l-e-d 共用。现在能够正确读取压缩包内的任意子文件夹,并保证输出风格一致。
  • 统一使用 7-Zip 作为解压后端:重构 extractArchive,将非 tar 包格式(.zip、.rar、.gz 等)统一交由单一依赖 7z 处理,大幅减少对 unzipbunzip2unrar 等多个系统命令的依赖。

🐛 修复

  • 嵌套压缩包内文件定位错误:旧代码仅凭文件名(Base Name)搜索,当压缩包内存在同名文件时会导致误判。引入 FileLocation 结构体,精确记录每个文件的相对路径,实现绝对精准的定位。
  • 状态污染:修复 config.contentMap 在处理多个文件时累积上一个文件状态的缺陷,现在每次处理新文件前会正确重置。
  • 临时目录残留风险:清理无用中间变量,统一使用 defer os.RemoveAll 管理临时目录生命周期,避免异常退出时垃圾文件堆积在 /tmp
  • 帮助信息格式异常:在 showHelp 中改用原始字符串硬编码 ANSI 颜色,解决因 Printf 参数不匹配导致的 %!s(MISSING) 格式错误。
  • 压缩包自追加时被误删:修改 addFilesToArchivecompressArchive,强制使用绝对路径,避免源压缩包在尝试自追加时被误删除并丢失于临时目录。
  • 添加文件时误报成功:在 addFilesToArchive 中增加 addedCount 计数器,若无有效文件被实际复制,则跳过重新打包并给出明确提示,修复了误报成功的问题。

⚡ 性能与安全

  • 移除无效的中间变量,降低内存开销,提升整体稳定性。

Changelog

🔧 Refactor

  • Unified tree parsing engine – Removed legacy listDir and listInTemp; added buildArchiveTree shared by -l, -e, -d. Now correctly reads arbitrary subfolders inside archives with consistent output styling.
  • Unified extraction backend with 7-Zip – Streamlined extractArchive by delegating non-tarball formats (.zip, .rar, .gz, etc.) to a single 7z dependency, drastically reducing the need for multiple system commands (unzip, bunzip2, unrar, etc.).

🐛 Fixes

  • Incorrect location of nested archive files – Old code used only base name for searching, causing misidentification when duplicate names existed inside archives. Introduced FileLocation struct to record exact relative paths, ensuring absolute accuracy.
  • State pollution – Fixed config.contentMap accumulating previous file states when processing multiple files. The map is now properly reset before each new file.
  • Temporary directory leak risk – Cleaned up unused intermediate variables; unified temp dir lifecycle with defer os.RemoveAll to prevent garbage accumulation in /tmp on abnormal exits.
  • Help text formatting errors – Hardcoded ANSI colors using raw strings in showHelp to fix %!s(MISSING) formatting errors caused by mismatched Printf arguments.
  • Archive self-deletion during self-append – Updated addFilesToArchive and compressArchive to enforce absolute paths, preventing the source archive from being deleted and lost in temporary directories during self-append attempts.
  • False-positive success on append – Added an addedCount tracker in addFilesToArchive to skip recompression and output a clear message if no valid files were actually copied, fixing false-positive success messages.

⚡ Performance & Security

  • Removed ineffective intermediate variables, reduced memory overhead, and improved overall stability.

v0.0.5 so fresh

02 Aug 02:57

Choose a tag to compare

更新日志

  1. 新增-e参数, 可提取压缩包内指定文件
  2. 修复无法删除嵌套压缩包内指定文件的bug

changelog

  1. Added the '-e' parameter to extract the specified files in the package
  2. Fixed a bug where the specified files in nested packages could not be deleted

v0.0.4 Smarter

01 Aug 15:44

Choose a tag to compare

更新日志

  1. 可以直接向压缩包内添加文件
  2. 可以单独删除压缩包内指定文件
  3. 优化代码逻辑更高效、更稳定、更智能

版本选择指南

根据您的操作系统和架构,请选择对应的安装文件以下是不同平台的版本对应关系:

操作系统 架构 文件名
Linux x86_64/AMD64 unbox-vx.x.x-linux_amd64
ARM64/AArch64 unbox-vx.x.x-linux_arm64
LoongArch unbox-vx.x.x-linux_loong64

changelog

  1. Add files directly to an archive.
  2. Remove individual files from an archive.
  3. Optimized codebase for higher efficiency, stability, and intelligence.

Version Selection Guide

Choose the installer that matches your OS and architecture:

Operating System Architecture Filename
Linux x86_64 / AMD64 unbox-vx.x.x-linux_amd64
ARM64 / AArch64 unbox-vx.x.x-linux_arm64
LoongArch unbox-vx.x.x-linux_loong64

v0.0.3

08 Jul 07:53

Choose a tag to compare

  1. 你现在可以预览嵌套压缩包内容
  2. 加入了对loong64架构Linux的支持

版本选择指南

根据您的操作系统和架构,请选择对应的安装文件以下是不同平台的版本对应关系:

操作系统 架构 文件名
Windows x86_64/AMD64 unbox-vx.x.x-windows_amd64.exe
ARM64/AArch64 unbox-vx.x.x-windows_arm64.exe
Linux x86_64/AMD64 unbox-vx.x.x-linux_amd64
ARM64/AArch64 unbox-vx.x.x-linux_arm64
LoongArch unbox-vx.x.x-linux_loong64
macOS Intel (x86_64/AMD64) unbox-vx.x.x-darwin_amd64
Apple Silicon (ARM64/AArch64) unbox-vx.x.x-darwin_arm64

v0.0.2

05 Jul 14:28

Choose a tag to compare

修复了递归解压失败的bug

v0.0.1

04 Jul 07:17

Choose a tag to compare

首个版本欢迎找茬😁