diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-03-08 17:03:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-08 17:03:59 +0100 |
commit | f378e82e2d57ee60e5b0f973eb1ea2ee3a760428 (patch) | |
tree | fb1f4a9e5a652c0be8ea98595e4e1c70712cdce1 /pkg/util/utils.go | |
parent | 9e12f6354c4997a7eed241e03dcf2875db20e197 (diff) | |
parent | cb51707f91e683323ba61fca49363a997ed1be1f (diff) | |
download | podman-f378e82e2d57ee60e5b0f973eb1ea2ee3a760428.tar.gz podman-f378e82e2d57ee60e5b0f973eb1ea2ee3a760428.tar.bz2 podman-f378e82e2d57ee60e5b0f973eb1ea2ee3a760428.zip |
Merge pull request #5412 from rhatdan/tmpdir
Allow users to set TMPDIR environment
Diffstat (limited to 'pkg/util/utils.go')
-rw-r--r-- | pkg/util/utils.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/util/utils.go b/pkg/util/utils.go index 4a52ea68d..a4df48c88 100644 --- a/pkg/util/utils.go +++ b/pkg/util/utils.go @@ -600,3 +600,12 @@ func HomeDir() (string, error) { } return home, nil } + +func Tmpdir() string { + tmpdir := os.Getenv("TMPDIR") + if tmpdir == "" { + tmpdir = "/var/tmp" + } + + return tmpdir +} |