Refactor .actrc locations and default image survey (#600)

* refactor: move survey/cfgs into own funcs, read XDG base dirs for config

Moved actrc locations to own func since it can be reused.
Moved survey part to own func due to high cyclomatic complexity.
Added XDG config dir to config locations.
Replaced using HOME envvar with go-homedir module since it's already
an indirect dependency and handles home directories better
for each GOOS.

* refactor: use `go-homedir`, check if XDG var is not empty
This commit is contained in:
hackercat
2021-04-05 17:51:13 +02:00
committed by GitHub
parent 47e1ba1b55
commit 4125812a63
4 changed files with 96 additions and 107 deletions

4
go.mod
View File

@@ -5,7 +5,6 @@ go 1.16
require (
github.com/AlecAivazis/survey/v2 v2.2.7
github.com/Masterminds/semver v1.5.0
github.com/MichaelTJones/walk v0.0.0-20161122175330-4748e29d5718 // indirect
github.com/andreaskoch/go-fswatch v1.0.0
github.com/containerd/containerd v1.4.1 // indirect
github.com/containerd/continuity v0.0.0-20200928162600-f2cc35102c2a // indirect
@@ -21,7 +20,7 @@ require (
github.com/joho/godotenv v1.3.0
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
github.com/mgutz/str v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0
github.com/moby/buildkit v0.8.1
github.com/moby/sys/mount v0.2.0 // indirect
github.com/opencontainers/image-spec v1.0.1
@@ -38,7 +37,6 @@ require (
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221
google.golang.org/genproto v0.0.0-20201117123952-62d171c70ae1 // indirect
google.golang.org/grpc v1.33.2 // indirect
gopkg.in/godo.v2 v2.0.9
gopkg.in/sourcemap.v1 v1.0.5 // indirect
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776
gotest.tools/v3 v3.0.2