Skip to content
This repository has been archived by the owner on Sep 22, 2021. It is now read-only.

Commit

Permalink
Patches to update script. Prep for 1.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas101 committed Jan 15, 2016
1 parent 5371c1e commit a8951c9
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wmail",
"version": "1.1.2",
"version": "1.1.3",
"description": "OSX app wrapper for Google Inbox and Google Mail",
"main": "src/main.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion package.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

electron-packager . "WMail" --platform=darwin --arch=all --version=0.36.2 --app-bundle-id="tombeverley.wmail" --app-version="1.1.2" --icon="icons/app.icns" --overwrite --ignore="/release/|/icons/|package.sh|screenshot.png|README.md";
electron-packager . "WMail" --platform=darwin --arch=all --version=0.36.2 --app-bundle-id="tombeverley.wmail" --app-version="1.1.3" --icon="icons/app.icns" --overwrite --ignore="/release/|/icons/|package.sh|screenshot.png|README.md";
mkdir ./WMail-darwin-x64/vendor-licenses;
mv ./WMail-darwin-x64/LICENSES.chromium.html ./WMail-darwin-x64/vendor-licenses/LICENSES.chromium.html;
mv ./WMail-darwin-x64/LICENSE ./WMail-darwin-x64/vendor-licenses/LICENSE.electron;
Expand Down
1 change: 0 additions & 1 deletion src/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class Analytics {
acc.push(k + '=' + encodeURIComponent(full_args[k]))
return acc
}, []).join('&')
console.log(qs)

const url = 'https://www.google-analytics.com/collect?' + qs
return fetch(url, { method: 'post' })
Expand Down
28 changes: 26 additions & 2 deletions src/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,31 @@ class Update {
fetch(constants.UPDATE_CHECK_URL).then((res) => {
return res.json()
}).then((json) => {
let latestTag = json[0].tag_name

const newRelease = json.find(release => {
let tag = release.tag_name
tag = tag.indexOf('v' === 0) ? tag.substr(1) : tag
return !release.prerelease && compareVersion(tag, pkg.version) >= 1
})

if (newRelease) {
let tag = newRelease.tag_name
tag = tag.indexOf('v' === 0) ? tag.substr(1) : tag
dialog.showMessageBox(window, {
type: 'question',
title:'Updates Available',
message:'Version ' + tag + ' is now available. Do you want to download it now?',
buttons: ['Download Now', 'Download Later'],
defaultId: 1,
}, (response) => {
if (response === 0) {
shell.openExternal(json.download_url)
}
})
}

//prerelease
/*let latestTag = json[0].tag_name
latestTag = latestTag.indexOf('v' === 0) ? latestTag.substr(1) : latestTag
if (compareVersion(latestTag, pkg.version) >= 1) {
dialog.showMessageBox(window, {
Expand All @@ -29,7 +53,7 @@ class Update {
shell.openExternal(json.download_url)
}
})
}
}*/
})
}
}
Expand Down

0 comments on commit a8951c9

Please sign in to comment.