1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-02 12:20:05 +02:00

auto update only on windows

This commit is contained in:
s2
2020-06-07 22:43:33 +02:00
parent b8a94f650f
commit 9873246826

View File

@@ -15,35 +15,37 @@ let repoDir = path.resolve(path.normalize(args._.join(' ')));
let repoRootDir = repoDir; let repoRootDir = repoDir;
//auto update stuff //auto update stuff
setTimeout(() => { if (process.platform === 'win32') {
gau.checkForUpdate({ setTimeout(() => {
currentVersion: app.getVersion(), gau.checkForUpdate({
repo: 'https://api.github.com/repos/S2-/gitlit/releases/latest', currentVersion: app.getVersion(),
assetMatch: /.+setup.+exe/i repo: 'https://api.github.com/repos/S2-/gitlit/releases/latest',
}); assetMatch: /.+setup.+exe/i
gau.onUpdateAvailable = (version, asset) => {
win.webContents.send('update', {
event: 'updateAvailable',
version: version
}); });
gau.downloadNewVersion(asset);
};
gau.onNewVersionReadyToInstall = (file) => { gau.onUpdateAvailable = (version, asset) => {
win.webContents.send('update', { win.webContents.send('update', {
event: 'updateReadyToInstall', event: 'updateAvailable',
file: file version: version
}); });
}; gau.downloadNewVersion(asset);
};
ipcMain.on('installUpdate', (event, file) => { gau.onNewVersionReadyToInstall = (file) => {
gau.executeUpdate(file); win.webContents.send('update', {
win.webContents.send('update', { event: 'updateReadyToInstall',
event: 'updateInstalling' file: file
});
};
ipcMain.on('installUpdate', (event, file) => {
gau.executeUpdate(file);
win.webContents.send('update', {
event: 'updateInstalling'
});
}); });
}); }, 5000);
}, 5000); }
//end update stuff //end update stuff