Use /home/georg/.gott/ to store data
parent
33370b4b2d
commit
61e46b7b6e
9
main.go
9
main.go
|
@ -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)
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue