This commit is contained in:
cdle 2021-08-21 17:45:37 +08:00
parent 1fa8dfba52
commit 11fdf8da1b
2 changed files with 3 additions and 3 deletions

2
.gitignore vendored
View File

@ -23,4 +23,4 @@ conf/reply.php
jdCookie.js
scripts/node_modules
task/*
repos
*.repo

View File

@ -16,7 +16,7 @@ type Repo struct {
var reposPath = ""
func (rp *Repo) init() {
rp.filename = strings.Replace(strings.Replace(rp.Git, "https://", "", -1), "/", "_", -1)
rp.filename = strings.Replace(strings.Replace(strings.Replace(rp.Git, "https://", "", -1), "/", "_", -1), ".git", "", -1)
if !rp.exist() {
rp.gitClone()
}
@ -32,7 +32,7 @@ func (rp *Repo) exist() bool {
func initRepos() {
reposPath = ExecPath + "/repos"
if _, err := os.Stat(reposPath); err != nil {
os.MkdirAll(reposPath, os.ModePerm)
os.MkdirAll(reposPath, 777)
}
for _, repo := range Config.Repos {
repo.init()