MakeTempDir creates a temp directory with the zarf- prefix.
(basePath string)
| 32 | |
| 33 | // MakeTempDir creates a temp directory with the zarf- prefix. |
| 34 | func MakeTempDir(basePath string) (string, error) { |
| 35 | if basePath != "" { |
| 36 | if err := helpers.CreateDirectory(basePath, helpers.ReadWriteExecuteUser); err != nil { |
| 37 | return "", err |
| 38 | } |
| 39 | } |
| 40 | tmp, err := os.MkdirTemp(basePath, tmpPathPrefix) |
| 41 | if err != nil { |
| 42 | return "", err |
| 43 | } |
| 44 | return tmp, nil |
| 45 | } |
| 46 | |
| 47 | // GetFinalExecutablePath returns the absolute path to the current executable, following any symlinks along the way. |
| 48 | func GetFinalExecutablePath() (string, error) { |
no outgoing calls
no test coverage detected