log whats happening in auto-updater

This commit is contained in:
akashnimare
2017-02-02 12:02:56 +05:30
parent 0923df7250
commit a5d42e8ccd
2 changed files with 12 additions and 6 deletions

View File

@@ -1,23 +1,28 @@
'use strict';
const os = require('os');
// const os = require('os');
const {app, dialog} = require('electron');
const {autoUpdater} = require("electron-updater").autoUpdater;
const {autoUpdater} = require('electron-updater').autoUpdater;
// We don't need to call all of these since it's automatically handled by electron-updater
//const version = app.getVersion();
//const platform = os.platform() + '_' + os.arch(); // usually returns darwin_64
//const updaterFeedURL = 'http://zulipdesktop.herokuapp.com/update/' + platform + '/' + version;
// const version = app.getVersion();
// const platform = os.platform() + '_' + os.arch(); // usually returns darwin_64
// const updaterFeedURL = 'http://zulipdesktop.herokuapp.com/update/' + platform + '/' + version;
function appUpdater() {
//autoUpdater.setFeedURL(updaterFeedURL);
// autoUpdater.setFeedURL(updaterFeedURL);
// Log whats happening
const log = require('electron-log');
log.transports.file.level = 'info';
autoUpdater.logger = log;
// TODO send autoUpdater events to renderer so that we could
// it could console log in developer tools
/*
autoUpdater.on('error', err => console.log(err));
autoUpdater.on('checking-for-update', () => console.log('checking-for-update'));
autoUpdater.on('update-available', () => console.log('update-available'));
autoUpdater.on('update-not-available', () => console.log('update-not-available'));
*/
// Ask the user if update is available
autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => {