Releases: Geekstrange/Unbox
v0.0.7 Expanded
v0.0.7
✨ 新特性
-
扩展支持格式与解压行为改进:移除 CLI 验证阶段的硬编码格式白名单,将格式判断完全交由
7z后端决定,不再仅靠扩展名拦截。新增tar.zst/tzst在解压与压缩中的完整支持。扩充isCompressedFile启发式检测名单,涵盖cab、iso、arj、lzh、cpio、rpm、deb、dmg、wim、vhd、zst,提升嵌套压缩包识别能力。解压时自动创建以压缩包命名的子目录,避免解压内容散落在当前目录。 -
更新树形视图样式:将树形输出中的
└──替换为╰─,├──替换为├─,并使用灰色(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
7zdecide compatibility instead of gating by extension. Addedtar.zst/tzstsupport to bothextractArchiveandcompressArchive. ExtendedisCompressedFileheuristic withcab,iso,arj,lzh,cpio,rpm,deb,dmg,wim,vhd,zstfor 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
代号释义:“Reforge”意为重铸、锻造新生。本次重构将零散的旧逻辑熔炼为一套统一的解析引擎,并统一解压后端,修复多个关键问题。
变更日志
🔧 重构
- 统一树状解析引擎:移除冗余的
listDir与listInTemp函数,新增buildArchiveTree供-l、-e、-d共用。现在能够正确读取压缩包内的任意子文件夹,并保证输出风格一致。 - 统一使用 7-Zip 作为解压后端:重构
extractArchive,将非 tar 包格式(.zip、.rar、.gz 等)统一交由单一依赖7z处理,大幅减少对unzip、bunzip2、unrar等多个系统命令的依赖。
🐛 修复
- 嵌套压缩包内文件定位错误:旧代码仅凭文件名(Base Name)搜索,当压缩包内存在同名文件时会导致误判。引入
FileLocation结构体,精确记录每个文件的相对路径,实现绝对精准的定位。 - 状态污染:修复
config.contentMap在处理多个文件时累积上一个文件状态的缺陷,现在每次处理新文件前会正确重置。 - 临时目录残留风险:清理无用中间变量,统一使用
defer os.RemoveAll管理临时目录生命周期,避免异常退出时垃圾文件堆积在/tmp。 - 帮助信息格式异常:在
showHelp中改用原始字符串硬编码 ANSI 颜色,解决因 Printf 参数不匹配导致的%!s(MISSING)格式错误。 - 压缩包自追加时被误删:修改
addFilesToArchive和compressArchive,强制使用绝对路径,避免源压缩包在尝试自追加时被误删除并丢失于临时目录。 - 添加文件时误报成功:在
addFilesToArchive中增加addedCount计数器,若无有效文件被实际复制,则跳过重新打包并给出明确提示,修复了误报成功的问题。
⚡ 性能与安全
- 移除无效的中间变量,降低内存开销,提升整体稳定性。
Changelog
🔧 Refactor
- Unified tree parsing engine – Removed legacy
listDirandlistInTemp; addedbuildArchiveTreeshared by-l,-e,-d. Now correctly reads arbitrary subfolders inside archives with consistent output styling. - Unified extraction backend with 7-Zip – Streamlined
extractArchiveby delegating non-tarball formats (.zip, .rar, .gz, etc.) to a single7zdependency, 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
FileLocationstruct to record exact relative paths, ensuring absolute accuracy. - State pollution – Fixed
config.contentMapaccumulating 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.RemoveAllto prevent garbage accumulation in/tmpon abnormal exits. - Help text formatting errors – Hardcoded ANSI colors using raw strings in
showHelpto fix%!s(MISSING)formatting errors caused by mismatched Printf arguments. - Archive self-deletion during self-append – Updated
addFilesToArchiveandcompressArchiveto 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
addedCounttracker inaddFilesToArchiveto 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
更新日志
- 新增
-e参数, 可提取压缩包内指定文件 - 修复无法删除嵌套压缩包内指定文件的bug
changelog
- Added the '-e' parameter to extract the specified files in the package
- Fixed a bug where the specified files in nested packages could not be deleted
v0.0.4 Smarter
更新日志
- 可以直接向压缩包内添加文件
- 可以单独删除压缩包内指定文件
- 优化代码逻辑更高效、更稳定、更智能
版本选择指南
根据您的操作系统和架构,请选择对应的安装文件以下是不同平台的版本对应关系:
| 操作系统 | 架构 | 文件名 |
|---|---|---|
| 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
- Add files directly to an archive.
- Remove individual files from an archive.
- 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
- 你现在可以预览嵌套压缩包内容
- 加入了对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
修复了递归解压失败的bug
v0.0.1
首个版本欢迎找茬😁