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

8 Commits

Author SHA1 Message Date
s2
ce50a38e35 2.0.7 2020-07-07 11:50:30 +02:00
s2
133f72df2a fix updater 2020-07-07 11:50:21 +02:00
s2
bebaf95f70 2.0.6 2020-07-07 10:42:56 +02:00
s2
e719261427 update to latest electron version 2020-07-07 10:40:27 +02:00
s2
1fe4d0d90c 2.0.5 2020-06-07 22:43:44 +02:00
s2
9873246826 auto update only on windows 2020-06-07 22:43:33 +02:00
s2
b8a94f650f 2.0.4 2020-06-07 22:17:29 +02:00
s2
e97a5c1fc2 just readme 2020-06-07 22:17:26 +02:00
6 changed files with 1062 additions and 1600 deletions

View File

@@ -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

View File

@@ -2,6 +2,8 @@
const ipcRenderer = require('electron').ipcRenderer;
const remote = require('electron').remote;
const electronFind = require('electron-find');
const dialog = remote.require('electron').dialog;
let findInPage = new electronFind.FindInPage(remote.getCurrentWebContents());
let firstRun = true;
@@ -121,12 +123,15 @@
$(document).on('click', '.js-open-folder', (ev) => {
ev.preventDefault();
$('.js-open-folder-input').trigger('click');
});
$(document).on('change', '.js-open-folder-input', (ev) => {
ev.preventDefault();
ipcRenderer.send('restart', $('.js-open-folder-input')[0].files[0].path);
dialog.showOpenDialog({
properties: ['openDirectory']
})
.then((path) => {
if (path && path.filePaths.length > 0) {
ipcRenderer.send('restart', path.filePaths[0]);
};
});
});
$(document).on('keypress', (ev) => {

View File

@@ -15,35 +15,38 @@ 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'
});
app.quit();
});
});
}, 5000);
}, 5000);
}
//end update stuff
@@ -160,7 +163,15 @@ function loadRepoPage() {
function createWindow() {
// Create the browser window.
win = new BrowserWindow({title: 'gitlit v' + app.getVersion(), width: 800, height: 700});
win = new BrowserWindow({
title: 'gitlit v' + app.getVersion(),
width: 800,
height: 700,
webPreferences: {
nodeIntegration: true,
enableRemoteModule: true
}
});
win.setMenu(null);
// and load the index.html of the app.
@@ -257,9 +268,3 @@ ipcMain.on('restart', (event, newRepoDir) => {
app.on('ready', () => {
startup(createWindow);
});
app.on('window-all-closed', function() {
if (process.platform != 'darwin') {
app.quit();
}
});

View File

@@ -1,4 +1,3 @@
<div class="text-center">
<a class="btn btn-primary js-open-folder" href="javascript:///">Open another folder</a>
<input type="file" style="display: none" class="js-open-folder-input" webkitdirectory />
</div>

2565
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "gitlit",
"version": "2.0.3",
"version": "2.0.7",
"description": "",
"main": "app/main.js",
"build": {
@@ -29,11 +29,11 @@
"dependencies": {
"animate.css": "^3.5.2",
"bootstrap": "^4.5.0",
"ejs": "^2.7.4",
"ejs": "^3.1.3",
"ejs-render-remote": "^1.0.13",
"electron-find": "^1.0.6",
"electron-localshortcut": "^3.2.1",
"github-app-updater": "^1.0.2",
"github-app-updater": "^1.0.4",
"jquery": "^3.5.1",
"material-design-icons": "^3.0.1",
"minimist": "^1.2.5",
@@ -42,8 +42,8 @@
"popper.js": "^1.16.1"
},
"devDependencies": {
"electron": "^3.1.13",
"electron-builder": "^20.44.4"
"electron": "^9.1.0",
"electron-builder": "^22.7.0"
},
"scripts": {
"start": "electron .",