@cloud-print/submodule
v1.0.0
Published
Cloud Print CLI - Git Submodule 删除工具
Readme
@cloud-print/submodule
通过关键字检索 .gitmodules 并删除对应的 git submodule。
安装
npm install -g @cloud-print/submodule使用
假设 .gitmodules 中有如下配置:
[submodule "src/uni_modules/kf-uniapp-error-handler"]
path = src/uni_modules/kf-uniapp-error-handler
url = [email protected]:example/kf-uniapp-error-handler.git只需输入包名关键字即可删除:
# 在 Git 仓库根目录执行
submodule-rm kf-uniapp-error-handler选项
| 选项 | 说明 |
|------|------|
| -C, --cwd <path> | 指定 Git 仓库根目录(默认当前目录) |
| --dry-run | 仅预览匹配结果,不执行删除 |
| -y, --yes | 跳过确认,直接删除 |
示例
# 预览匹配结果
submodule-rm kf-uniapp-error-handler --dry-run
# 指定仓库目录
submodule-rm kf-uniapp-error-handler -C /path/to/repo
# 跳过确认
submodule-rm kf-uniapp-error-handler -y开发
cd packages/submodule
pnpm build
node dist/index.js kf-uniapp-error-handler --dry-run