Browse Source

Use `filepath` instead of `path` to create SQLite3 database file (#28374) (#28378)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Fix #28300
tags/v1.21.2
Giteabot 5 months ago
parent
commit
5eaf91e919
No account linked to committer's email address
1 changed files with 1 additions and 2 deletions
  1. 1
    2
      modules/setting/database.go

+ 1
- 2
modules/setting/database.go View File

@@ -9,7 +9,6 @@ import (
"net"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"time"
@@ -117,7 +116,7 @@ func DBConnStr() (string, error) {
if !EnableSQLite3 {
return "", errors.New("this Gitea binary was not built with SQLite3 support")
}
if err := os.MkdirAll(path.Dir(Database.Path), os.ModePerm); err != nil {
if err := os.MkdirAll(filepath.Dir(Database.Path), os.ModePerm); err != nil {
return "", fmt.Errorf("Failed to create directories: %w", err)
}
journalMode := ""

Loading…
Cancel
Save