mirror of
https://github.com/idanoo/NZCovidBot
synced 2025-07-03 04:02:14 +00:00
Update README.md, Add comments
This commit is contained in:
parent
a884ed7f46
commit
c79f5e7e7e
3 changed files with 10 additions and 0 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue