mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-02-05 17:28:23 +08:00
update manager
This commit is contained in:
parent
2420cadf70
commit
71f67c359f
@ -3,6 +3,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/go-git/go-git/v5"
|
"github.com/go-git/go-git/v5"
|
||||||
)
|
)
|
||||||
@ -42,9 +43,15 @@ func main() {
|
|||||||
/* pull the pikascript repo */
|
/* pull the pikascript repo */
|
||||||
r, _ := git.PlainOpen(path)
|
r, _ := git.PlainOpen(path)
|
||||||
w, _ := r.Worktree()
|
w, _ := r.Worktree()
|
||||||
fmt.Println("updateing pikascript...")
|
fmt.Println("updating pikascript...")
|
||||||
w.Pull(&git.PullOptions{RemoteName: "origin"})
|
w.Pull(&git.PullOptions{RemoteName: "origin"})
|
||||||
ref, _ := r.Head()
|
ref, _ := r.Head()
|
||||||
commit, _ := r.CommitObject(ref.Hash())
|
commit, _ := r.CommitObject(ref.Hash())
|
||||||
fmt.Println(commit)
|
fmt.Println(commit)
|
||||||
|
|
||||||
|
fmt.Println("update OK !")
|
||||||
|
for i := 3; i > 0; i-- {
|
||||||
|
time.Sleep(1 * time.Second)
|
||||||
|
fmt.Println("this window will auto close after", i, "s...")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user