Use /home/georg/.gott/ to store data

main
Georg Krause 2020-01-16 13:52:21 +01:00
parent 33370b4b2d
commit 61e46b7b6e
1 changed files with 7 additions and 2 deletions

View File

@ -51,6 +51,10 @@ func start(tags []string) Record {
}
func stop(entry *Record, tags []string) {
if entry == nil {
fmt.Println("No active tracking")
return
}
fmt.Print(time.Now().Format("2 Jan 2006 15:04:05"))
fmt.Println(" Stop record")
for _, tag := range tags {
@ -61,6 +65,7 @@ func stop(entry *Record, tags []string) {
func main() {
datafile := os.Getenv("HOME") + "/.gott/data.json"
args := os.Args[1:]
// representation of the data
@ -69,7 +74,7 @@ func main() {
}
jsonFile, err := os.Open("test.json")
jsonFile, err := os.Open(datafile)
if err != nil {
fmt.Println(err)
@ -104,6 +109,6 @@ func main() {
}
file, _ := json.MarshalIndent(data, "", " ")
_ = ioutil.WriteFile("test.json", file, 0644)
_ = ioutil.WriteFile(datafile, file, 0644)
}