summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/util/utils.go9
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
+}