mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Use filepath instead of path to create SQLite3 database file (#28374)
				
					
				
			This commit is contained in:
		@@ -9,7 +9,6 @@ import (
 | 
				
			|||||||
	"net"
 | 
						"net"
 | 
				
			||||||
	"net/url"
 | 
						"net/url"
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
	"path"
 | 
					 | 
				
			||||||
	"path/filepath"
 | 
						"path/filepath"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
@@ -117,7 +116,7 @@ func DBConnStr() (string, error) {
 | 
				
			|||||||
		if !EnableSQLite3 {
 | 
							if !EnableSQLite3 {
 | 
				
			||||||
			return "", errors.New("this Gitea binary was not built with SQLite3 support")
 | 
								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)
 | 
								return "", fmt.Errorf("Failed to create directories: %w", err)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		journalMode := ""
 | 
							journalMode := ""
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user