diff --git a/README.md b/README.md index 82fe694..731a16c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A time blocking service that can be run locally or remotely as a server # Installation Requires Go >= 1.20 -Run `git clone https://github.com/dethancosta/timeruler`. From the cloned directory, run `go install ./cmd/tr-server`. +Run `git clone https://github.com/dethancosta/timeruler`. From the cloned directory, run `go install -o timeruler ./cmd/tr-server`. # Usage API documentation coming soon. If using [trctl](https://github.com/dethancosta/trctl), run `trctl` for available commands diff --git a/cmd/tr-server/main.go b/cmd/tr-server/main.go index 4a5df61..4710e06 100644 --- a/cmd/tr-server/main.go +++ b/cmd/tr-server/main.go @@ -2,7 +2,6 @@ package main import ( "flag" - //"io" "log" "net/http" "strconv" diff --git a/cmd/tr-server/standalone.go b/cmd/tr-server/standalone.go index c6d6a51..837837d 100644 --- a/cmd/tr-server/standalone.go +++ b/cmd/tr-server/standalone.go @@ -26,6 +26,14 @@ func SetPid(address, port string) error { config := make(map[string]string) configFile, err := os.OpenFile(configPath, os.O_RDWR, 0644) if err != nil && os.IsNotExist(err) { + configDir, err := scope.ConfigPath("") + if err != nil { + return err + } + err = os.MkdirAll(configDir, os.ModePerm) + if err != nil { + return err + } configFile, err = os.Create(configPath) if err != nil { return err diff --git a/tr-server b/tr-server new file mode 100755 index 0000000..4b120b1 Binary files /dev/null and b/tr-server differ