Skip to content

Commit

Permalink
Build script + check for updates
Browse files Browse the repository at this point in the history
  • Loading branch information
th-ch committed Apr 19, 2019
1 parent 9d343bf commit b3c24a5
Show file tree
Hide file tree
Showing 5 changed files with 663 additions and 828 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
/dist
/assets/generated
/assets/generated
electron-builder.yml
20 changes: 18 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"use strict";
const path = require("path");

const electron = require("electron");
const isDev = require("electron-is-dev");
const electron = require("electron");
const isDev = require("electron-is-dev");
const { autoUpdater } = require("electron-updater");

const { setApplicationMenu } = require("./menu");
const { getEnabledPlugins, store } = require("./store");
Expand All @@ -15,6 +16,7 @@ require("electron-debug")();

// Prevent window being garbage collected
let mainWindow;
autoUpdater.autoDownload = false;

let icon = "assets/youtube-music.png";
if (process.platform == "win32") {
Expand Down Expand Up @@ -120,6 +122,20 @@ app.on("activate", () => {
app.on("ready", () => {
setApplicationMenu();
mainWindow = createMainWindow();
if (!isDev) {
autoUpdater.checkForUpdatesAndNotify();
autoUpdater.on("update-available", () => {
const dialogOpts = {
type : "info",
buttons: ["OK"],
title : "Application Update",
message: "A new version is available",
detail :
"A new version is available and can be downloaded at https:/th-ch/youtube-music/releases/latest"
};
electron.dialog.showMessageBox(dialogOpts);
});
}

// Optimized for Mac OS X
if (process.platform === "darwin") {
Expand Down
Loading

0 comments on commit b3c24a5

Please sign in to comment.