فهرست منبع

Fix random avatar does not work on Windows

path.Dir can't handle Windows case, must use filepath.Dir
Unknwon 10 سال پیش
والد
کامیت
5a27aea8e0
3فایلهای تغییر یافته به همراه3 افزوده شده و 4 حذف شده
  1. 1 1
      gogs.go
  2. 1 2
      models/user.go
  3. 1 1
      templates/.VERSION

+ 1 - 1
gogs.go

@@ -17,7 +17,7 @@ import (
 	"github.com/gogits/gogs/modules/setting"
 )
 
-const APP_VER = "0.8.27.0201"
+const APP_VER = "0.8.27.0202"
 
 func init() {
 	runtime.GOMAXPROCS(runtime.NumCPU())

+ 1 - 2
models/user.go

@@ -16,7 +16,6 @@ import (
 	_ "image/jpeg"
 	"image/png"
 	"os"
-	"path"
 	"path/filepath"
 	"strings"
 	"time"
@@ -211,7 +210,7 @@ func (u *User) GenerateRandomAvatar() error {
 	if err != nil {
 		return fmt.Errorf("RandomImage: %v", err)
 	}
-	if err = os.MkdirAll(path.Dir(u.CustomAvatarPath()), os.ModePerm); err != nil {
+	if err = os.MkdirAll(filepath.Dir(u.CustomAvatarPath()), os.ModePerm); err != nil {
 		return fmt.Errorf("MkdirAll: %v", err)
 	}
 	fw, err := os.Create(u.CustomAvatarPath())

+ 1 - 1
templates/.VERSION

@@ -1 +1 @@
-0.8.27.0201
+0.8.27.0202