Skip to content

Commit

Permalink
Move tracker command to cmd dir
Browse files Browse the repository at this point in the history
  • Loading branch information
lucapette committed Feb 20, 2017
1 parent 4140f17 commit 7a4a78b
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -16,10 +16,10 @@ lint: ## Run all the linters
ci: lint test ## Run all the tests and code checks

assets: ## Embed static assets
go-bindata -o static.go categories.csv
go-bindata -pkg tracker -o static.go categories.csv

build: assets ## Build a dev version of tracker
go build
go build cmd/tracker.go
gofmt -w static.go

# Absolutely awesome: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
Expand Down
2 changes: 1 addition & 1 deletion activity.go
@@ -1,4 +1,4 @@
package main
package tracker

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion activity_test.go
@@ -1,4 +1,4 @@
package main
package tracker

import (
"reflect"
Expand Down
2 changes: 1 addition & 1 deletion category.go
@@ -1,4 +1,4 @@
package main
package tracker

import (
"log"
Expand Down
5 changes: 3 additions & 2 deletions main.go → cmd/tracker.go
@@ -1,6 +1,7 @@
package main

import (
"github.com/lucapette/tracker"
"log"
"os"
"os/signal"
Expand All @@ -11,12 +12,12 @@ func main() {
go func() {
tick := time.Tick(1 * time.Second)
for range tick {
name, err := GetActivityName()
name, err := tracker.GetActivityName()
if err != nil {
log.Println(err)
}

a := NewActivity(name)
a := tracker.NewActivity(name)

err = a.Store()
if err != nil {
Expand Down
7 changes: 7 additions & 0 deletions goreleaser.yml
@@ -0,0 +1,7 @@
build:
main: 'cmd/tracker.go'
goos:
- darwin
goarch:
- 386
- amd64
2 changes: 1 addition & 1 deletion script.go
@@ -1,4 +1,4 @@
package main
package tracker

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion static.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7a4a78b

Please sign in to comment.