From ffc37b192dd570b1105895c48df81977d204fe02 Mon Sep 17 00:00:00 2001
From: dnelband <dnelband@gmail.com>
Date: Thu, 29 Aug 2019 13:42:55 +0200
Subject: [PATCH] update-electron-app

---
 app/main.js       |  7 ++++++-
 package-lock.json | 29 +++++++++++++++++++++++++++++
 package.json      |  3 ++-
 3 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/app/main.js b/app/main.js
index cad8743..033c73e 100644
--- a/app/main.js
+++ b/app/main.js
@@ -3,7 +3,6 @@ const {spawn} = require('child_process');
 
 const {app, BrowserWindow, ipcMain} = require('electron');
 const ElectronStore = require('electron-store');
-const {autoUpdater} = require('electron-updater');
 const request = require('request');
 
 // Set configs dir
@@ -93,6 +92,12 @@ function createWindow() {
 
     mainWindow.loadURL(indexFileUrl);
     mainWindow.maximize();
+    require('update-electron-app')({
+        repo: 'dfn2/pling-store',
+        host: 'http://www.opencode.net',
+        updateInterval: '1 hour',
+        logger: require('electron-log')
+    })
     
     mainWindow.on('close', () => {
         const appConfigStore = new ElectronStore({name: appConfigStoreStorage});
diff --git a/package-lock.json b/package-lock.json
index f538c33..602c106 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -401,6 +401,11 @@
         "sumchecker": "^2.0.2"
       }
     },
+    "electron-is-dev": {
+      "version": "0.3.0",
+      "resolved": "https://registry.npmjs.org/electron-is-dev/-/electron-is-dev-0.3.0.tgz",
+      "integrity": "sha1-FOb9pcaOnk7L7/nM8DfL18BcWv4="
+    },
     "electron-notarize": {
       "version": "0.0.5",
       "resolved": "https://registry.npmjs.org/electron-notarize/-/electron-notarize-0.0.5.tgz",
@@ -802,6 +807,14 @@
         "assert-plus": "^1.0.0"
       }
     },
+    "github-url-to-object": {
+      "version": "4.0.4",
+      "resolved": "https://registry.npmjs.org/github-url-to-object/-/github-url-to-object-4.0.4.tgz",
+      "integrity": "sha512-1Ri1pR8XTfzLpbtPz5MlW/amGNdNReuExPsbF9rxLsBfO1GH9RtDBamhJikd0knMWq3RTTQDbTtw0GGvvEAJEA==",
+      "requires": {
+        "is-url": "^1.1.0"
+      }
+    },
     "glob": {
       "version": "7.1.3",
       "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
@@ -921,6 +934,11 @@
       "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
       "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
     },
+    "is-url": {
+      "version": "1.2.4",
+      "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz",
+      "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww=="
+    },
     "is-utf8": {
       "version": "0.2.1",
       "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
@@ -1787,6 +1805,17 @@
       "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
       "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg=="
     },
+    "update-electron-app": {
+      "version": "1.5.0",
+      "resolved": "https://registry.npmjs.org/update-electron-app/-/update-electron-app-1.5.0.tgz",
+      "integrity": "sha512-g7noW9JfQ8Hwq6zw9lmZei+R/ikOIBcaZ04TbmIcU5zNfv23HkN80QLLAyiR/47KvfS4sjnh2/wuDq5nh8+0mQ==",
+      "requires": {
+        "electron-is-dev": "^0.3.0",
+        "github-url-to-object": "^4.0.4",
+        "is-url": "^1.2.4",
+        "ms": "^2.1.1"
+      }
+    },
     "uri-js": {
       "version": "4.2.2",
       "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz",
diff --git a/package.json b/package.json
index 2140f8e..c21f5f3 100644
--- a/package.json
+++ b/package.json
@@ -20,7 +20,8 @@
     "electron-updater": "^4.1.2",
     "esm": "3.*.*",
     "lit-html": "1.*.*",
-    "request": "2.*.*"
+    "request": "2.*.*",
+    "update-electron-app": "^1.5.0"
   },
   "devDependencies": {
     "electron": "4.*.*",
-- 
GitLab