Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Don't retrieve user information when retrieving homedir for cache #169

Merged
merged 1 commit into from
Jan 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Gopkg.lock

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

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@
[[constraint]]
name = "github.com/containers/image"
revision = "abb4cd79e3427bb2b02a5930814ef2ad19983c24"

[[constraint]]
branch = "master"
name = "github.com/mitchellh/go-homedir"
1 change: 1 addition & 0 deletions cmd/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ go_library(
"//pkg/util:go_default_library",
"//util:go_default_library",
"//vendor/github.com/docker/docker/client:go_default_library",
"//vendor/github.com/mitchellh/go-homedir:go_default_library",
"//vendor/github.com/sirupsen/logrus:go_default_library",
"//vendor/github.com/spf13/cobra:go_default_library",
"//vendor/github.com/spf13/pflag:go_default_library",
Expand Down
6 changes: 3 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
goflag "flag"
"fmt"
"os"
"os/user"
"path/filepath"
"sort"
"strings"
Expand All @@ -30,6 +29,7 @@ import (
pkgutil "github.com/GoogleCloudPlatform/container-diff/pkg/util"
"github.com/GoogleCloudPlatform/container-diff/util"
"github.com/docker/docker/client"
homedir "github.com/mitchellh/go-homedir"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
Expand Down Expand Up @@ -168,11 +168,11 @@ func getPrepperForImage(image string) (pkgutil.Prepper, error) {
}

func cacheDir() (string, error) {
user, err := user.Current()
dir, err := homedir.Dir()
if err != nil {
return "", err
}
rootDir := filepath.Join(user.HomeDir, ".container-diff")
rootDir := filepath.Join(dir, ".container-diff")
return filepath.Join(rootDir, "cache"), nil
}

Expand Down
15 changes: 15 additions & 0 deletions vendor/github.com/mitchellh/go-homedir/BUILD.bazel

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

21 changes: 21 additions & 0 deletions vendor/github.com/mitchellh/go-homedir/LICENSE

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

14 changes: 14 additions & 0 deletions vendor/github.com/mitchellh/go-homedir/README.md

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

137 changes: 137 additions & 0 deletions vendor/github.com/mitchellh/go-homedir/homedir.go

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

112 changes: 112 additions & 0 deletions vendor/github.com/mitchellh/go-homedir/homedir_test.go

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