mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
added git pull and checkout commands
This commit is contained in:
@@ -69,6 +69,19 @@ func (repo *GitRepo) repository() string {
|
||||
|
||||
return str
|
||||
}
|
||||
func (repo *GitRepo) pull() string {
|
||||
arg := []string{repo.gitDir(), repo.workTree(), "pull"}
|
||||
cmd := exec.Command("git", arg...)
|
||||
str := wtf.ExecuteCommand(cmd)
|
||||
return str
|
||||
}
|
||||
|
||||
func (repo *GitRepo) checkout(branch string) string {
|
||||
arg := []string{repo.gitDir(), repo.workTree(), "checkout", branch}
|
||||
cmd := exec.Command("git", arg...)
|
||||
str := wtf.ExecuteCommand(cmd)
|
||||
return str
|
||||
}
|
||||
|
||||
func (repo *GitRepo) gitDir() string {
|
||||
return fmt.Sprintf("--git-dir=%s/.git", repo.Path)
|
||||
|
||||
Reference in New Issue
Block a user