Skip to content

Commit

Permalink
trigger ci
Browse files Browse the repository at this point in the history
  • Loading branch information
erguotou520 committed Feb 9, 2018
1 parent c6c3441 commit 1419f17
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ branches:
only:
- master

if: tag IS present
# if: tag IS present
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ branches:
only:
- master

skip_non_tags: true
# skip_non_tags: true

image: Visual Studio 2017
platform:
Expand Down
5 changes: 5 additions & 0 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@
<summary>加密方法、协议、混淆中没有我想设置的选项怎么办?</summary>
<p>请右击任务栏图标-配置-选项设置...,然后切换到SSR设置选项卡中自行添加。</p>
</details>

<details>
<summary>我的linux系统提示有新版本升级,但是我点击通知并没有跳转到下载页面?</summary>
<p>1,建议使用AppImage包。 2,参考<a href="https://github.com/electron/electron/issues/9919">https://github.com/electron/electron/issues/9919</a>&nbsp;以及&nbsp;<a href="https://github.com/electron/electron/issues/8474">https://github.com/electron/electron/issues/8474</a></p>
</details>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "electron-ssr",
"version": "0.2.0-beta-3",
"version": "0.2.0-beta-4",
"author": "erguotou <[email protected]>",
"description": "Cross platform ShadowsocksR GUI client built with electron",
"homepage": "https://github.com/erguotou520/electron-ssr/",
Expand Down
13 changes: 8 additions & 5 deletions src/main/updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ autoUpdater
showNotification('应用已完成更新,下次启动将加载最新版本')
})

// 版本升级check
export function versionCheck (oldVersion, newVersion) {
const oldArr = oldVersion.split('-')
const newArr = newVersion.split('-')
Expand All @@ -47,7 +48,7 @@ export function versionCheck (oldVersion, newVersion) {
return true
} else {
// 0.2.0-beta-1 vs 0.2.0-beta-2
return newArr[1] > oldArr[1]
return `${newArr[1]}${newArr[2] ? newArr[2] : ''}` > `${oldArr[1]}${oldArr[2] ? oldArr[2] : ''}`
}
}

Expand All @@ -58,11 +59,13 @@ export function checkUpdate (force = false) {
const remotePkg = JSON.parse(data)
const currentVersion = pkg.version
const isOutdated = versionCheck(currentVersion, remotePkg.version)
showNotification(isOutdated ? `最新版本为 v${remotePkg.version},点击前往下载。` : '当前已是最新版', '通知', () => {
if (isOutdated) {
if (isOutdated) {
showNotification(`最新版本为 v${remotePkg.version},点击前往下载。`, '通知', () => {
shell.openExternal('https://github.com/erguotou520/electron-ssr/releases')
}
})
})
} else if (force) {
showNotification('当前已是最新版,无需更新')
}
})
} else {
forceUpdate = force
Expand Down

0 comments on commit 1419f17

Please sign in to comment.