From cb51707f91e683323ba61fca49363a997ed1be1f Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Fri, 6 Mar 2020 07:39:32 -0500 Subject: Allow users to set TMPDIR environment Some users have small /var/tmp directories and need to be able to specify a different location for temporary files, which includes more space. Signed-off-by: Daniel J Walsh --- pkg/util/utils.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pkg/util') 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 +} -- cgit v1.2.3-54-g00ecf