1
0
Fork 0

feat: introduce temp dir helper

master
dump_stack() 2023-05-13 11:29:25 +00:00
parent 997d6a67ba
commit 5ada1ef41a
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC
1 changed files with 7 additions and 0 deletions

View File

@ -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"), "")
}