From 5ada1ef41a15c8e40e6cca894321ff0e591b30fb Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Sat, 13 May 2023 11:29:25 +0000 Subject: [PATCH] feat: introduce temp dir helper --- fs/fs.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/fs.go b/fs/fs.go index b2fa879..cb483f8 100644 --- a/fs/fs.go +++ b/fs/fs.go @@ -3,6 +3,8 @@ package fs import ( "os" "path/filepath" + + "code.dumpstack.io/tools/out-of-tree/config" ) // CaseInsensitive check @@ -44,3 +46,8 @@ func PathExists(path string) bool { } return true } + +// TempDir that exist relative to config directory +func TempDir() (string, error) { + return os.MkdirTemp(config.Dir("tmp"), "") +}