mirror of
https://github.com/stashapp/stash.git
synced 2026-04-19 05:23:30 +02:00
Ensure tmp dir is created before creating temp file (#5977)
This commit is contained in:
parent
bd8ec8cb83
commit
7215b6e918
1 changed files with 3 additions and 0 deletions
|
|
@ -43,6 +43,9 @@ func (gp *generatedPaths) GetTmpPath(fileName string) string {
|
|||
// TempFile creates a temporary file using os.CreateTemp.
|
||||
// It is the equivalent of calling os.CreateTemp using Tmp and pattern.
|
||||
func (gp *generatedPaths) TempFile(pattern string) (*os.File, error) {
|
||||
if err := gp.EnsureTmpDir(); err != nil {
|
||||
logger.Warnf("Could not ensure existence of a temporary directory: %v", err)
|
||||
}
|
||||
return os.CreateTemp(gp.Tmp, pattern)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue