Skip to content

Commit

Permalink
Use filepath instead of path to create SQLite3 database file (#28374
Browse files Browse the repository at this point in the history
) (#28378)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Fix #28300
  • Loading branch information
GiteaBot authored Dec 6, 2023
1 parent b7e3adc commit 5eaf91e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions modules/setting/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"net"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"time"
Expand Down Expand Up @@ -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 := ""
Expand Down

0 comments on commit 5eaf91e

Please sign in to comment.