12 Star 44 Fork 6

Gitee 极速下载 / lazygit

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/jesseduffield/lazygit
克隆/下载
test.go 759 Bytes
一键复制 编辑 原始数据 按行查看 历史
package test
import (
"github.com/go-errors/errors"
"os"
"os/exec"
"path/filepath"
"github.com/jesseduffield/lazygit/pkg/utils"
)
// GenerateRepo generates a repo from test/repos and changes the directory to be
// inside the newly made repo
func GenerateRepo(filename string) error {
reposDir := "/test/repos/"
testPath := utils.GetProjectRoot() + reposDir
// workaround for debian packaging
if _, err := os.Stat(testPath); os.IsNotExist(err) {
cwd, _ := os.Getwd()
testPath = filepath.Dir(filepath.Dir(cwd)) + reposDir
}
if err := os.Chdir(testPath); err != nil {
return err
}
if output, err := exec.Command("bash", filename).CombinedOutput(); err != nil {
return errors.New(string(output))
}
return os.Chdir(testPath + "repo")
}
Shell
1
https://gitee.com/mirrors/lazygit.git
git@gitee.com:mirrors/lazygit.git
mirrors
lazygit
lazygit
v0.8.1

搜索帮助