Update README.md, Add comments

This commit is contained in:
Daniel Mason 2021-09-02 11:08:26 +12:00
parent a884ed7f46
commit c79f5e7e7e
Signed by: idanoo
GPG key ID: 387387CDBC02F132
3 changed files with 10 additions and 0 deletions

View file

@ -20,6 +20,7 @@ var commitHash string
// Location to store tmp data
var tmpDirectory = "./tmp"
// loadRepo Load repo into gitRepo var
func loadRepo(repository string) {
r, err := git.PlainOpen(tmpDirectory + "/repo")
if err != nil {
@ -35,6 +36,7 @@ func loadRepo(repository string) {
gitRepo = r
}
// cloneRepo Clone git repo
func cloneRepo(repository string) *git.Repository {
if _, err := os.Stat(tmpDirectory); os.IsNotExist(err) {
err = os.Mkdir(tmpDirectory, 0755)
@ -160,6 +162,9 @@ func checkForUpdates() {
}
}
// Store current hash for future comparisons
setCommitHash(head.Hash().String())
// SEND IT o/---->
postTheUpdates()
}