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