1.0.0 • Published 4 years ago

pi_project_cli v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

项目脚手架工具

项目目录结构

  • pi_demo
    • pi_sys
    • pi_build
    • pi_gui
    • pi_pt
    • pi_demo
      • scripts
        • pi_demo.conf
        • git_pull.bat
        • git_install.bat

新人获取代码,新建 目录 pi_demo,在里面操作:

git的nodejs库

https://github.com/steveukx/git-js

需求

  • 获取代码
    • 本地找不到目录,clone:指定 url-本地路径-分支|tag|hash
    • 本地找到目录,如果git status不是想要的:pull | checkout:指定 url-本地路径-分支|tag|hash
  • 分支 或 tag 或 hash
    • 对项目git库,一般都是 获取 给定分支 的最新版本
    • 对底层git库,一般都是 获取 给定tag的代码

tag 字段 | branch 字段 | commit_hash 字段

  • 注意: 两种字段,不能共存,需要加配置合法性判断
  • 有tag,更新到对应的tag版本,失败则报错
  • 有branch:指定的分支对应最新版本,失败则报错
  • 有commit_hash:指定的分支对应最新版本,失败则报错
  • 都没有:报错

参考的 命令行 用法

*.conf 一般放到项目的scripts目录下;

node git_update.js ./project.conf ./lib.conf

*.conf 范本

[{
    "path": "../../pi_sys",
    "url": "http://192.168.31.241:10080/tech/pi_sys.git",
    "branch": "master"
}, {
    "path": "../../pi_build",
    "url": "http://192.168.31.241:10080/tech/pi_build.git",
    "tag": "1.0"
}, {
    "path": "../../pi_gui",
    "url": "http://192.168.31.241:10080/tech/pi_gui.git",
    "branch": "master"
}, {
    "path": "../../pi_sys",
    "url": "http://192.168.31.241:10080/tech/pi_sys.git",
    "branch": "master"
}, {
    "path": "../../pi_babylon",
    "url": "http://192.168.31.241:10080/tech/pi_babylon.git",
    "branch": "master"
}, {
    "path": "../../pi_pt",
    "url": "http://192.168.31.241:10080/tech/pi_pt.git",
    "branch": "master"
}]
1.0.0

4 years ago