From fdb67f70a77fae1ad45285c5a6787ed76f7bef4d Mon Sep 17 00:00:00 2001 From: Nicholas Thomson Date: Thu, 10 Jun 2021 13:06:27 -0700 Subject: [PATCH 1/2] Remove unnecessary homedir module --- cmd/ack-generate/command/root.go | 3 +-- go.mod | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/cmd/ack-generate/command/root.go b/cmd/ack-generate/command/root.go index 4e771468..9bf17df4 100644 --- a/cmd/ack-generate/command/root.go +++ b/cmd/ack-generate/command/root.go @@ -18,7 +18,6 @@ import ( "os" "path/filepath" - "github.com/mitchellh/go-homedir" "github.com/spf13/cobra" ) @@ -62,7 +61,7 @@ func init() { os.Exit(1) } - hd, err := homedir.Dir() + hd, err := os.UserHomeDir() if err != nil { fmt.Printf("unable to determine $HOME: %s\n", err) os.Exit(1) diff --git a/go.mod b/go.mod index 81530ba6..2a65f001 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,6 @@ require ( github.com/gertd/go-pluralize v0.1.1 github.com/ghodss/yaml v1.0.0 github.com/iancoleman/strcase v0.1.3 - github.com/mitchellh/go-homedir v1.1.0 github.com/operator-framework/api v0.6.0 github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.1.1 From d9da0d600fd35eb6916362f887a7bb27f19cdae8 Mon Sep 17 00:00:00 2001 From: Nicholas Thomson Date: Thu, 10 Jun 2021 13:27:06 -0700 Subject: [PATCH 2/2] Default cache dir to full homedir path --- scripts/build-controller.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-controller.sh b/scripts/build-controller.sh index 8090f6de..173e5f24 100755 --- a/scripts/build-controller.sh +++ b/scripts/build-controller.sh @@ -19,7 +19,7 @@ if ! k8s_controller_gen_version_equals "$CONTROLLER_TOOLS_VERSION"; then exit 1 fi -ACK_GENERATE_CACHE_DIR=${ACK_GENERATE_CACHE_DIR:-"~/.cache/aws-controllers-k8s"} +ACK_GENERATE_CACHE_DIR=${ACK_GENERATE_CACHE_DIR:-"$HOME/.cache/aws-controllers-k8s"} # The ack-generate code generator is in a separate source code repository, # typically at $GOPATH/src/github.com/aws-controllers-k8s/code-generator DEFAULT_ACK_GENERATE_BIN_PATH="$ROOT_DIR/bin/ack-generate"