internal

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add added in v0.0.2

func Add(rootDir, project, dir, branch string) (repository string)

Add 添加远程项目,branch 默认为 main

func Clone added in v0.0.2

func Clone(rootDir, project, repository string) (dir string)

Clone 克隆远程项目

func Commit added in v0.0.3

func Commit(rootDir, msg string)

Commit 提交项目修改

func ContainsString

func ContainsString(array []string, val string) int

ContainsString 在一个 string 数组中进行查找,找不到返回 -1。

func Push added in v0.0.2

func Push(rootDir, project, dir, branch string)

Push 推送远程项目,branch 默认为 main

func Release added in v0.0.2

func Release(rootDir, tag string)

Release 发布远程项目

func Remotes added in v0.0.2

func Remotes(rootDir string) []string

Remotes 返回远程项目列表

func Remove added in v0.0.2

func Remove(rootDir, project string)

Remove 删除远程项目

func SafeStash added in v0.0.2

func SafeStash(rootDir string, fn func())

SafeStash 安全地暂存和恢复用户未提交的修改

func Sync added in v0.0.2

func Sync(rootDir, project, dir, branch string)

Sync 同步远程项目,branch 默认为 main

func Zip added in v0.0.2

func Zip(rootDir string)

zip 备份本地文件

Types

type Command

type Command []string

Command 封装 os 命令行参数

func NewCommand

func NewCommand(cmd string, args ...string) Command

NewCommand Command 的构造函数

func (Command) RunOnBuffer added in v0.0.3

func (cmd Command) RunOnBuffer(workDir string) (string, error)

Run 执行 os 命令行

func (Command) RunOnConsole added in v0.0.3

func (cmd Command) RunOnConsole(workDir string) error

Run 执行 os 命令行

type Project added in v0.0.2

type Project struct {
	Name   string `xml:"name"`
	Dir    string `xml:"dir"`
	Url    string `xml:"url"`
	Branch string `xml:"branch"`
}

type ProjectXml added in v0.0.2

type ProjectXml struct {
	XMLName  xml.Name  `xml:"projects"`
	Projects []Project `xml:"project"`
}

func (*ProjectXml) Add added in v0.0.2

func (p *ProjectXml) Add(project Project)

Add 添加一个项目

func (*ProjectXml) Find added in v0.0.3

func (p *ProjectXml) Find(project string) (Project, bool)

Find 查找一个项目,成功返回 true,失败返回 false

func (*ProjectXml) Read added in v0.0.2

func (p *ProjectXml) Read(filename string) error

Read 读取配置文件

func (*ProjectXml) Remove added in v0.0.2

func (p *ProjectXml) Remove(project string)

Remove 移除一个项目

func (*ProjectXml) Save added in v0.0.2

func (p *ProjectXml) Save(filename string) error

Save 保存配置文件

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL