Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Iago Cavalcante committed Jul 30, 2018
1 parent ceb5460 commit eba01fa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
3 changes: 2 additions & 1 deletion src-electron/main-process/auto-updater/auto-updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { app, autoUpdater, dialog } from 'electron'
const version = app.getVersion()
const platform = os.platform() + '_' + os.arch() // usually returns darwin_64

const updaterFeedURL = 'https://api.github.com/repos/iagocavalcante/qtube/releases/latest'
// const updaterFeedURL = 'https://api.github.com/repos/iagocavalcante/qtube/releases/latest'

export const appUpdater = () => {
const updaterFeedURL = `https://qtube-release.herokuapp.com/update/${platform}/${version}`
autoUpdater.setFeedURL(updaterFeedURL);
/* Log whats happening
TODO send autoUpdater events to renderer so that we could console log it in developer tools
Expand Down
25 changes: 13 additions & 12 deletions src-electron/main-process/electron-main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { app, BrowserWindow, ipcMain } from 'electron'
import server from './server/server.js'
// import utilUpdater from './auto-updater/auto-updater.js'
import utilUpdater from './auto-updater/auto-updater.js'
import { autoUpdater } from 'electron-updater'
import fs from 'fs'
const log = require('electron-log')
Expand All @@ -13,9 +13,9 @@ if (process.env.PROD) {
}

// configure logging
autoUpdater.logger = log
autoUpdater.logger.transports.file.level = 'info'
log.info('App starting...')
// autoUpdater.logger = log
// autoUpdater.logger.transports.file.level = 'info'
// log.info('App starting...')

if (require('electron-squirrel-startup')) app.quit()

Expand Down Expand Up @@ -62,22 +62,23 @@ function createWindow () {

server.listen(defaultPath)
autoUpdater.checkForUpdates()
// const checkOS = isWindowsOrmacOS()
// if ( checkOS ) {
// // Initate auto-updates on macOs and windows
// utilUpdater.appUpdater()
// }
const checkOS = isWindowsOrmacOS()
if ( checkOS ) {
// Initate auto-updates on macOs and windows
utilUpdater.appUpdater()
}
if (handleSquirrel) return
autoUpdater.checkForUpdatesAndNotify();
}

// autoUpdater.on('update-downloaded', (info) => {
// mainWindow.webContents.send('updateReady')
// })

// when receiving a quitAndInstall signal, quit and install the new version )
// ipcMain.on('quitAndInstall', (event, arg) => {
// autoUpdater.quitAndInstall()
// })
ipcMain.on('quitAndInstall', (event, arg) => {
autoUpdater.quitAndInstall()
})

ipcMain.on('close-app', (event) => {
if (process.platform !== 'darwin') {
Expand Down

0 comments on commit eba01fa

Please sign in to comment.