This commit is contained in:
kingecg 2025-09-13 20:47:14 +08:00
parent e57ee27b95
commit 8d718985bf
3 changed files with 80 additions and 1 deletions

35
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,35 @@
# 贡献指南
欢迎为 GoPacker 项目贡献代码!以下是贡献流程和规范。
## 开发流程
1. Fork 本项目到你的 GitHub 账户。
2. 克隆你的 Fork 到本地:
```bash
git clone https://github.com/your-username/gopacker.git
```
3. 创建新分支:
```bash
git checkout -b feature/your-feature
```
4. 提交代码变更并推送到你的 Fork
```bash
git push origin feature/your-feature
```
5. 提交 Pull Request 到主仓库的 `main` 分支。
## 代码风格
- 遵循 Go 官方代码风格(使用 `gofmt` 格式化代码)。
- 提交信息需清晰描述变更内容。
- 确保代码通过测试(如果有)。
## 构建与测试
- 使用 `make build` 构建项目。
- 运行 `make clean` 清理构建产物。
## 问题反馈
请在 GitHub Issues 中报告问题或提出建议。

44
README.md Normal file
View File

@ -0,0 +1,44 @@
# GoPacker
一个用于将可执行的 boot 程序和资源文件打包成单个文件的命令行工具。
## 功能
- 将 boot 程序和多个资源文件打包成一个文件。
- 支持单个文件和文件夹作为资源输入。
- 记录资源文件的相对路径和偏移量。
- 在输出文件末尾附加资源文件的元数据JSON 格式)。
## 安装
1. 克隆仓库:
```bash
git clone https://github.com/kingecg/code/gopacker.git
```
2. 构建工具:
```bash
make build
```
构建完成后,可执行文件位于 `./bin/packer`
## 使用方法
```bash
./bin/packer -b /path/to/boot -f /path/to/resource1 -f /path/to/resource2 -o /path/to/output
```
### 参数说明
- `-b`:指定 boot 程序路径(必需)。
- `-f`:指定资源文件或文件夹路径(可多次使用)。
- `-o`:指定输出文件路径(必需)。
## 示例
```bash
./bin/packer -b ./boot.bin -f ./resources -f ./config.json -o ./output.bin
```
## 许可证
MIT

2
go.mod
View File

@ -1,3 +1,3 @@
module git.kingecg.top/kingecg/gopacker
go 1.23.1
go 1.23