1.2.2 • Published 9 months ago
@hhorg/hh-cli v1.2.2
@hhorg/hh-cli
项目基础架构脚手架。环境要求:node(任意版本)
一、全局安装脚手架,命令行执行:
npm install @hhorg/hh-cli -g
二、初始化项目模板
hh init
选择一个项目模板,自动初始化项目,及自动安装依赖
三、配置脚手架内置config.json文件,操作命令,如下:
执行指令后,会自动打开config.json配置文件,自行去配置配置项,命令行执行:
hh sync_config
四、config.json配置文件中各字段含义:
字段 | 类型 | 含义 | 备注 |
---|---|---|---|
blackList | Array | 文件同步黑名单 | 默认:"git", "node_modules", "dist", "yarn.lock", "package-lock" |
sourcePath | String | 本地源仓库文件夹路径 | pwd获取绝对路径(如:/Users/fanghui/projects_plugins/node-copy-repo/xiaohui) |
targetPath | String | 本地目标仓库文件夹路径 | |
targetBranch | String | 想要提交到目标仓库的分支 | pushGit为true时生效 |
pushGit | Boolern | 是否直接push到目标仓库远端 | true:是;false:否 |
pushGitCommitName | String | 提交远端的commit名称 | 提交的真正commit会在本名称后默认加上时间戳(如:同步-1712796640434)。pushGit为true时生效 |
五、配置完成后,执行同步代码操作,(基于脚手架内置config.json文件),命令行执行:
hh sync
六、脚手架工具版本,如下:
hh -v // 查看当前脚手架工具版本