summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-12-07 01:22:18 +0800
committerGitHub <noreply@github.com>2023-12-06 11:22:18 -0600
commit5eaf91e91983d860e2b21b11c82a4d8f2db1e39f (patch)
tree0b40362633bc1834bb1cc7e8dd3eb9ed53a0e434 /modules
parentb7e3adc66c01dc6c81126ca4c031cad48d6eb6c4 (diff)
downloadgitea-5eaf91e91983d860e2b21b11c82a4d8f2db1e39f.tar.gz
gitea-5eaf91e91983d860e2b21b11c82a4d8f2db1e39f.zip
Use `filepath` instead of `path` to create SQLite3 database file (#28374) (#28378)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Fix #28300
Diffstat (limited to 'modules')
-rw-r--r--modules/setting/database.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/modules/setting/database.go b/modules/setting/database.go
index 761e767e8f..b68f250f78 100644
--- a/modules/setting/database.go
+++ b/modules/setting/database.go
@@ -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 := ""