mirror of https://github.com/Xhofe/alist
refactor(patch): execute all patches in dev version (#7807)
parent
fd51f34efa
commit
027edcbe53
|
@ -2,6 +2,7 @@ package bootstrap
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/alist-org/alist/v3/internal/bootstrap/patch"
|
||||
"github.com/alist-org/alist/v3/internal/conf"
|
||||
"github.com/alist-org/alist/v3/pkg/utils"
|
||||
|
@ -40,6 +41,11 @@ func compareVersion(majorA, minorA, patchNumA, majorB, minorB, patchNumB int) bo
|
|||
|
||||
func InitUpgradePatch() {
|
||||
if !strings.HasPrefix(conf.Version, "v") {
|
||||
for _, vp := range patch.UpgradePatches {
|
||||
for i, p := range vp.Patches {
|
||||
safeCall(vp.Version, i, p)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
if LastLaunchedVersion == conf.Version {
|
||||
|
|
|
@ -11,14 +11,11 @@ import (
|
|||
// PR AlistGo/alist#7817.
|
||||
func GrantAdminPermissions() {
|
||||
admin, err := op.GetAdmin()
|
||||
if err == nil && (admin.Permission & 0x33FF) == 0 {
|
||||
admin.Permission |= 0x33FF
|
||||
err = op.UpdateUser(admin)
|
||||
}
|
||||
if err != nil {
|
||||
utils.Log.Errorf("Cannot grant permissions to admin: %v", err)
|
||||
}
|
||||
if (admin.Permission & 0x33FF) == 0 {
|
||||
admin.Permission |= 0x33FF
|
||||
err = op.UpdateUser(admin)
|
||||
if err != nil {
|
||||
utils.Log.Errorf("Cannot grant permissions to admin: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue