Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libra] 为 libra init 命令实现 [directory] 参数 #819

Merged

Conversation

Ricky-Daxia
Copy link
Contributor

[标题] 为 libra init 命令实现 [directory] 参数

[任务简述]
Mega 项目是使用 Rust 编程语言开发的兼容 Git 的 Monorepo 引擎,其中的 libra 模块实现了 Git 客户端的部分功能,目前尚未支持所有 Git 子命令及参数。本任务将为 libra init 命令添加 [directory] 参数,以支持用户自定义仓库的创建目录。

[实现方案]
1.参考libra其他子命令的方式,在 InitArgs 结构体中添加 directory 参数,通过 Parse 库解析命令行参数
2.读取参数后,创建对应的 PathBuf,先判断该路径是否可以正常写入,不可写时返回对应的错误,可写时在目标路径创建仓库
3.在 libra init -h 命令中添加 [directory] 参数的帮助信息
4.为修改后的代码编写单元测试并运行通过

Signed-off-by: Ricky-Daxia <[email protected]>
Copy link

vercel bot commented Jan 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mega ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 28, 2025 3:12am

@genedna genedna added this pull request to the merge queue Jan 28, 2025
Merged via the queue into web3infra-foundation:main with commit 839b810 Jan 28, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants