mirror of
https://github.com/S2-/gitlit
synced 2025-08-02 20:30:05 +02:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
1fe4d0d90c
|
|||
9873246826
|
|||
b8a94f650f
|
|||
e97a5c1fc2
|
@@ -46,7 +46,7 @@ npm run dist
|
||||
```
|
||||
|
||||
## notes
|
||||
Since version 2.0.1 the app auto updates itself.
|
||||
Since version 2.0.1 the app auto updates itself using the [github-app-updater](https://www.npmjs.com/package/github-app-updater).
|
||||
|
||||
## license
|
||||
|
||||
|
52
app/main.js
52
app/main.js
@@ -15,35 +15,37 @@ let repoDir = path.resolve(path.normalize(args._.join(' ')));
|
||||
let repoRootDir = repoDir;
|
||||
|
||||
//auto update stuff
|
||||
setTimeout(() => {
|
||||
gau.checkForUpdate({
|
||||
currentVersion: app.getVersion(),
|
||||
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
|
||||
if (process.platform === 'win32') {
|
||||
setTimeout(() => {
|
||||
gau.checkForUpdate({
|
||||
currentVersion: app.getVersion(),
|
||||
repo: 'https://api.github.com/repos/S2-/gitlit/releases/latest',
|
||||
assetMatch: /.+setup.+exe/i
|
||||
});
|
||||
gau.downloadNewVersion(asset);
|
||||
};
|
||||
|
||||
gau.onNewVersionReadyToInstall = (file) => {
|
||||
win.webContents.send('update', {
|
||||
event: 'updateReadyToInstall',
|
||||
file: file
|
||||
});
|
||||
};
|
||||
gau.onUpdateAvailable = (version, asset) => {
|
||||
win.webContents.send('update', {
|
||||
event: 'updateAvailable',
|
||||
version: version
|
||||
});
|
||||
gau.downloadNewVersion(asset);
|
||||
};
|
||||
|
||||
ipcMain.on('installUpdate', (event, file) => {
|
||||
gau.executeUpdate(file);
|
||||
win.webContents.send('update', {
|
||||
event: 'updateInstalling'
|
||||
gau.onNewVersionReadyToInstall = (file) => {
|
||||
win.webContents.send('update', {
|
||||
event: 'updateReadyToInstall',
|
||||
file: file
|
||||
});
|
||||
};
|
||||
|
||||
ipcMain.on('installUpdate', (event, file) => {
|
||||
gau.executeUpdate(file);
|
||||
win.webContents.send('update', {
|
||||
event: 'updateInstalling'
|
||||
});
|
||||
});
|
||||
});
|
||||
}, 5000);
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
//end update stuff
|
||||
|
||||
|
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gitlit",
|
||||
"version": "2.0.3",
|
||||
"version": "2.0.5",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gitlit",
|
||||
"version": "2.0.3",
|
||||
"version": "2.0.5",
|
||||
"description": "",
|
||||
"main": "app/main.js",
|
||||
"build": {
|
||||
|
Reference in New Issue
Block a user