mirror of
https://github.com/go-gitea/gitea.git
synced 2025-04-08 17:05:45 +02:00
Fix
This commit is contained in:
parent
fc448b5125
commit
1ad7ee8076
@ -17,7 +17,7 @@ import (
|
||||
)
|
||||
|
||||
func testRun(m *testing.M) error {
|
||||
gitHomePath, err := os.MkdirTemp(os.TempDir(), "git-home")
|
||||
gitHomePath, err := os.MkdirTemp(setting.TempDir(), "git-home")
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to create temp dir: %w", err)
|
||||
}
|
||||
|
@ -23,12 +23,13 @@ var (
|
||||
// AppName is the Application name, used in the page title. ini: "APP_NAME"
|
||||
AppName string
|
||||
|
||||
tempDir string
|
||||
createTempOnce sync.Once
|
||||
)
|
||||
|
||||
// TempDir returns the OS temp directory
|
||||
func TempDir() string {
|
||||
tempDir := filepath.Join(os.TempDir(), "gitea")
|
||||
tempDir = filepath.Join(os.TempDir(), "gitea")
|
||||
createTempOnce.Do(func() {
|
||||
if err := os.MkdirAll(tempDir, os.ModePerm); err != nil {
|
||||
log.Fatalf("Failed to create temp directory %s: %v", tempDir, err)
|
||||
@ -38,5 +39,5 @@ func TempDir() string {
|
||||
}
|
||||
|
||||
func CleanUpTempDirs() {
|
||||
_ = os.RemoveAll(TempDir())
|
||||
//_ = os.RemoveAll(TempDir())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user