Skip to content

Commit

Permalink
[main] update mishiro-core
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi committed Aug 31, 2018
1 parent 892c10a commit b401d41
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 12 deletions.
132 changes: 126 additions & 6 deletions app/package-lock.json

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

4 changes: 2 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mishiro",
"version": "1.4.0",
"version": "1.4.1",
"description": "mishiro",
"main": "./public/mishiro.main.js",
"scripts": {
Expand Down Expand Up @@ -64,7 +64,7 @@
"dependencies": {
"fs-extra": "^7.0.0",
"marked": "^0.3.14",
"mishiro-core": "^1.1.2",
"mishiro-core": "^1.2.0",
"sqlite3": "^4.0.2",
"zauz": "^1.0.2"
}
Expand Down
10 changes: 6 additions & 4 deletions app/src/ts/renderer/mishiro-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,17 @@ export default class extends Vue {
}
const releases = {
url: 'https://api.github.com/repos/toyobayashi/mishiro/releases',
json: true,
headers
}
const tags = {
url: 'https://api.github.com/repos/toyobayashi/mishiro/tags',
json: true,
headers
}
this.core.util.request(releases, (err, body) => {
this.core.util.request(releases, (err, _res, body) => {
if (!err) {
const latest = JSON.parse(body as string)[0]
const latest = body[0]
const version = latest.tag_name.substr(1)
if (remote.app.getVersion() >= version) {
this.$emit('checked')
Expand All @@ -61,10 +63,10 @@ export default class extends Vue {
const exeUrl = exe ? exe.browser_download_url : null
const patchUrl = patch ? patch.browser_download_url : null

this.core.util.request(tags, (err, body) => {
this.core.util.request(tags, (err, _res, body) => {
this.$emit('checked')
if (!err) {
const latestTag = JSON.parse(body as string).filter((tag: any) => tag.name === latest.tag_name)[0]
const latestTag = body.filter((tag: any) => tag.name === latest.tag_name)[0]
const commit = latestTag.commit.sha
const versionData = { version, commit, description, zipUrl, exeUrl, patchUrl }
console.log(versionData)
Expand Down

0 comments on commit b401d41

Please sign in to comment.