Skip to content
This repository has been archived by the owner on May 16, 2022. It is now read-only.

Commit

Permalink
Fix obtaining user home directory
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Shishkin <[email protected]>
  • Loading branch information
teran committed Jan 7, 2020
1 parent a5b7f4e commit c1910c1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/tagger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"log"
"os"
"path"
"time"

config "github.com/teran/eos-1v-tagger/config"
Expand All @@ -21,7 +22,11 @@ var (
func main() {
cfg := config.NewDefaultConfig()

err := cfg.FillFromYaml("~/.tagger/config.yaml")
home, err := os.UserHomeDir()
if err != nil {
log.Fatalf("error obtaining user home directory: %s", err)
}
err = cfg.FillFromYaml(path.Join(home, ".tagger", "config.yaml"))
if err != nil && !os.IsNotExist(err) {
log.Fatalf("error reading config file: %s", err)
}
Expand Down

0 comments on commit c1910c1

Please sign in to comment.