Skip to content

Commit

Permalink
启用ESlint,并对版本号获取逻辑进行调整
Browse files Browse the repository at this point in the history
  • Loading branch information
iamapig120 committed Jan 18, 2019
1 parent 8b3e403 commit 9afaa1b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
"extends": "google"
};
9 changes: 5 additions & 4 deletions manager/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const dialog = electronRemote.dialog
const AdmZip = require('adm-zip')
const os = require('os')

const app = electronRemote.app

// 注入脚本根文件根目录
const executeRootDir = path.join(__dirname, '../', configs.EXECUTE_DIR)
const executeSettingsFile = path.join(executeRootDir, './active.json')
Expand Down Expand Up @@ -1091,11 +1093,10 @@ const isLater = (taga, tagb) => {
}
const checkUpdate = userConfig => {
return new Promise((resolve, reject) => {
const locakPackage = require('../package.json')
/**
* @type {string}
*/
const versionLocal = locakPackage.version
const versionLocal = 'v' + app.getVersion()

const xhr = new XMLHttpRequest()
if (
Expand Down Expand Up @@ -1126,7 +1127,7 @@ const checkUpdate = userConfig => {
version: result.tag_name,
time: result.published_at,
body: result.body,
local: 'v' + locakPackage.version,
local: app.getVersion(),
html_url: result.html_url
})
} else {
Expand Down Expand Up @@ -1237,7 +1238,7 @@ const userConfigInit = () => {
const versionH3 = document.createElement('h3')
versionH3.innerText = getKeyText('loaclVersion')
const versionInfo = document.createElement('p')
versionInfo.innerText = require('../package.json').version
versionInfos.innerText = app.getVersion()
settingInner.append(versionH3)
settingInner.append(versionInfo)
}
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "majsoul-plus-client",
"version": "1.6.1",
"version": "1.6.2-alpha.1",
"productName": "Majsoul Plus",
"author": "MajsoulPlus Team",
"description": "Majsoul Plus",
Expand Down Expand Up @@ -31,6 +31,8 @@
"devDependencies": {
"cross-env": "^5.2.0",
"electron": "^2.0.12",
"electron-packager": "^13.0.1"
"electron-packager": "^13.0.1",
"eslint": "^5.12.0",
"eslint-config-google": "^0.11.0"
}
}

0 comments on commit 9afaa1b

Please sign in to comment.