Skip to content

Commit

Permalink
Add auto-update functionality and release script
Browse files Browse the repository at this point in the history
  • Loading branch information
joeynguyen committed Jan 29, 2019
1 parent f70d091 commit bfdb521
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules/
build/
dist/
electron-builder.yml
.vscode/
.env
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"electron-is-dev": "1.0.1",
"electron-log": "2.2.17",
"electron-unhandled": "2.1.0",
"electron-updater": "4.0.6",
"formik": "1.4.2",
"prop-types": "15.6.2",
"puppeteer": "1.11.0",
Expand Down Expand Up @@ -43,6 +44,7 @@
"electron-start": "electron .",
"builder:pack": "electron-builder --dir",
"builder:dist": "yarn build && electron-builder -lmw",
"publish": "yarn build && electron-builder -lmw -publish always",
"postinstall": "electron-builder install-app-deps",
"analyze:react": "yarn build --stats && webpack-bundle-analyzer build/bundle-stats.json",
"lint": "eslint --debug src/",
Expand All @@ -58,7 +60,12 @@
"productName": "Tagged Photos Scraper",
"mac": {
"category": "public.app-category.utilities"
}
},
"publish": [{
"provider": "github",
"owner": "joeynguyen",
"repo": "tagged-photos-scraper"
}]
},
"husky": {
"hooks": {
Expand Down
4 changes: 4 additions & 0 deletions public/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const { app, BrowserWindow, ipcMain, Menu, session } = electron;
const path = require('path');
const isDev = require('electron-is-dev');
const log = require('electron-log');
const { autoUpdater } = require('electron-updater');
const unhandled = require('electron-unhandled');

const scrape = require('./lib/scrape.js');
Expand Down Expand Up @@ -143,6 +144,8 @@ function createMenu() {
app.on('ready', async () => {
if (isDev) {
await installExtensions();
} else {
autoUpdater.checkForUpdatesAndNotify();
}
session.defaultSession.webRequest.onHeadersReceived((details, callback) => {
callback({
Expand Down Expand Up @@ -177,6 +180,7 @@ app.on('activate', function() {

// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

ipcMain.on(
'run-scraper',
(event, username, password, photoStartIndex, visualMode) => {
Expand Down
37 changes: 36 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2216,6 +2216,16 @@ builder-util-runtime@8.1.0, builder-util-runtime@^8.1.0:
fs-extra-p "^7.0.0"
sax "^1.2.4"

builder-util-runtime@~8.1.0:
version "8.1.1"
resolved "https://registry.yarnpkg.com/builder-util-runtime/-/builder-util-runtime-8.1.1.tgz#f2f6fc43e33d26892bd491667fc746ad69bccc50"
integrity sha512-+ieS4PMB33vVE2S3ZNWBEQJ1zKmAs/agrBdh7XadE1lKLjrH4aXYuOh9OOGdxqIRldhlhNBaF+yKMMEFOdNVig==
dependencies:
bluebird-lst "^1.0.6"
debug "^4.1.1"
fs-extra-p "^7.0.0"
sax "^1.2.4"

builder-util@9.6.1, builder-util@~9.6.0:
version "9.6.1"
resolved "https://registry.yarnpkg.com/builder-util/-/builder-util-9.6.1.tgz#4625620b1535fe40dcacb178d24fe56d0d7c8957"
Expand Down Expand Up @@ -3272,7 +3282,7 @@ debug@^3.0.0, debug@^3.1.0, debug@^3.2.5:
dependencies:
ms "^2.1.1"

debug@^4.0.1, debug@^4.1.0:
debug@^4.0.1, debug@^4.1.0, debug@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
Expand Down Expand Up @@ -3748,6 +3758,21 @@ electron-unhandled@2.1.0:
ensure-error "^1.0.0"
lodash.debounce "^4.0.8"

electron-updater@4.0.6:
version "4.0.6"
resolved "https://registry.yarnpkg.com/electron-updater/-/electron-updater-4.0.6.tgz#9c4f495ae0e80bf4425e3e1b801c5ed2ab933c2d"
integrity sha512-JPGLME6fxJcHG8hX7HWFl6Aew6iVm0DkcrENreKa5SUJCHG+uUaAhxDGDt+YGcNkyx1uJ6eBGMvFxDTLUv67pg==
dependencies:
bluebird-lst "^1.0.6"
builder-util-runtime "~8.1.0"
fs-extra-p "^7.0.0"
js-yaml "^3.12.0"
lazy-val "^1.0.3"
lodash.isequal "^4.5.0"
pako "^1.0.7"
semver "^5.6.0"
source-map-support "^0.5.9"

electron@4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/electron/-/electron-4.0.1.tgz#c41eaee9e081c2e5e4a4a4a761b7577a77d2eb18"
Expand Down Expand Up @@ -6947,6 +6972,11 @@ lodash.debounce@^4.0.8:
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168=

lodash.isequal@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA=

lodash.memoize@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe"
Expand Down Expand Up @@ -7969,6 +7999,11 @@ package-json@^4.0.0:
registry-url "^3.0.3"
semver "^5.1.0"

pako@^1.0.7:
version "1.0.8"
resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.8.tgz#6844890aab9c635af868ad5fecc62e8acbba3ea4"
integrity sha512-6i0HVbUfcKaTv+EG8ZTr75az7GFXcLYk9UyLEg7Notv/Ma+z/UG3TCoz6GiNeOrn1E/e63I0X/Hpw18jHOTUnA==

pako@~1.0.5:
version "1.0.7"
resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.7.tgz#2473439021b57f1516c82f58be7275ad8ef1bb27"
Expand Down

0 comments on commit bfdb521

Please sign in to comment.