@elfin-fe/command-tools
v1.2.22
Published
> tool 校精灵命令行工具
Downloads
74
Readme
安装
npm install @elfin-fe/command-tools
管理 external-libraries
配置 .external.config.js 文件
首先在工程根目录创建文件 .external.config.js
module.exports = [
{
sshAddress: '[email protected]',
skipInstall: true, // optional, default false, 不进行 npm install
tracks: { // optional, 配置本地分支对应的远端分支
localBranch: 'remote branch',
master: 'origin/v2.1.5',
}
},
]
初始化 external repositories
运行以下命令,对 external repositories
进行初始化
会自动创建一个 __external-libraries
目录
所有的依赖代码会放到这个目录中
elfin external init
重置 本地分支
与 远端分支
的对应关系
修改 .external.config.js
文件对应依赖项的 tracks
字段
设置本地分支与远端分支的对应关系
比如:
前端在 dev3 分支开发
但是后端的 common 工程在 v2.3.5 分支
这时就需要设置 dev3 -> v2.3.5 的对应关系
设置好之后,运行以下命令重置依赖工程
elfin external reset-remote
重置所有依赖工程的分支
如果你需要重置所有依赖工程的分支到主项目的分支
比如:
当前的 workbench 分支是 dev3
需要把所有的依赖工程也切换到 dev3 (如果某个工程的开发分支并不是 dev3,这时需要使用 tracks 字段进行关联)
elfin external reset-branch
另外,如果你想切换依赖工程到特定的分支,使用以下命令
elfin external reset-branch -b <branch-name>