Skip to content

Commit 01d3da4

Browse files
wxiaoguangGiteaBot
authored andcommitted
Use filepath instead of path to create SQLite3 database file (go-gitea#28374)
1 parent b7e3adc commit 01d3da4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

modules/setting/database.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"net"
1010
"net/url"
1111
"os"
12-
"path"
1312
"path/filepath"
1413
"strings"
1514
"time"
@@ -117,7 +116,7 @@ func DBConnStr() (string, error) {
117116
if !EnableSQLite3 {
118117
return "", errors.New("this Gitea binary was not built with SQLite3 support")
119118
}
120-
if err := os.MkdirAll(path.Dir(Database.Path), os.ModePerm); err != nil {
119+
if err := os.MkdirAll(filepath.Dir(Database.Path), os.ModePerm); err != nil {
121120
return "", fmt.Errorf("Failed to create directories: %w", err)
122121
}
123122
journalMode := ""

0 commit comments

Comments
 (0)