Skip to content

Commit

Permalink
🔖 发布 v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Apr 9, 2020
1 parent af15396 commit f6aece8
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 8 deletions.
15 changes: 13 additions & 2 deletions console/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
{
"name": "pipe-admin",
"version": "1.9.1",
"author": "Liyuan Li <v@b3log.org>",
"version": "2.0.0",
"author": {
"name": "B3log 开源社区",
"email": "os@b3log.org",
"url": "https://b3log.org"
},
"maintainers": [
{
"name": "Liyuan Li",
"email": "v@b3log.org",
"url": "http://vanessa.b3log.org"
}
],
"private": true,
"config": {
"nuxt": {
Expand Down
2 changes: 1 addition & 1 deletion model/confs.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
var logger = gulu.Log.NewLogger(os.Stdout)

// Version of Pipe.
const Version = "1.9.1"
const Version = "2.0.0"

// Conf of Pipe.
var Conf *Configuration
Expand Down
26 changes: 26 additions & 0 deletions service/upgradesrv.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,37 @@ func (srv *upgradeService) Perform() {
fallthrough
case "1.9.0":
perform190_191()
fallthrough
case "1.9.1":
perform191_200()
default:
logger.Fatalf("please upgrade to v1.8.7 first")
}
}

func perform191_200() {
fromVer := "1.9.1"
logger.Infof("upgrading from version [" + fromVer + "] to version [" + model.Version + "]....")

var verSettings []model.Setting
if err := db.Model(&model.Setting{}).Where("`name`= ?", model.SettingNameSystemVer).Find(&verSettings).Error; nil != err {
logger.Fatalf("load settings failed: %s", err)
}

tx := db.Begin()
for _, setting := range verSettings {
setting.Value = model.Version
if err := tx.Save(setting).Error; nil != err {
tx.Rollback()

logger.Fatalf("update setting [%+v] failed: %s", setting, err.Error())
}
}
tx.Commit()

logger.Infof("upgraded from version [" + fromVer + "] to version [" + model.Version + "] successfully")
}

func perform190_191() {
fromVer := "1.9.0"
logger.Infof("upgrading from version [" + fromVer + "] to version [" + model.Version + "]....")
Expand Down
13 changes: 9 additions & 4 deletions theme/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pipe",
"version": "1.9.1",
"version": "2.0.0",
"description": "Pipe theme",
"homepage": "https://github.com/88250/pipe",
"repository": {
Expand All @@ -12,11 +12,16 @@
},
"license": "GPLv3",
"private": true,
"author": "Vanessa <v@b3log.org> (http://vanessa.b3log.org)",
"author": {
"name": "B3log 开源社区",
"email": "os@b3log.org",
"url": "https://b3log.org"
},
"maintainers": [
{
"name": "Vanessa",
"email": "v@b3log.org"
"name": "Liyuan Li",
"email": "v@b3log.org",
"url": "http://vanessa.b3log.org"
}
],
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion theme/sw.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f6aece8

Please sign in to comment.