mirror of
https://github.com/S2-/gitlit
synced 2025-08-02 12:20:05 +02:00
handle no git repo case
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
$('.js-container').html(gitlit.templates.main({files: files}));
|
||||
});
|
||||
|
||||
ipcRenderer.on('isNoGitLfsRepo', (event, repoDir) => {
|
||||
$('.js-container').html(gitlit.templates.isNoGitLfsRepo({repoDir: repoDir}));
|
||||
});
|
||||
|
||||
ipcRenderer.on('notification', (event, notification) => {
|
||||
if (notification.message) {
|
||||
var notice = PNotify.alert({
|
||||
|
@@ -38,5 +38,10 @@ gitlit.templates = {
|
||||
Refresh
|
||||
</a>
|
||||
</div>
|
||||
`)
|
||||
`),
|
||||
isNoGitLfsRepo: ejs.compile(`
|
||||
<div class="alert alert-danger">
|
||||
<%= repoDir %> is not a git lfs repo.
|
||||
</div>
|
||||
`)
|
||||
};
|
||||
|
@@ -103,12 +103,16 @@ function createWindow() {
|
||||
getLfsFileList(repoDir, (err, files) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
|
||||
win.webContents.send('isNoGitLfsRepo', repoDir);
|
||||
return;
|
||||
}
|
||||
getLfsLocks(repoDir, (err, lockedFiles) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
|
||||
win.webContents.send('isNoGitLfsRepo', repoDir);
|
||||
return;
|
||||
}
|
||||
let allFiles = [];
|
||||
|
||||
|
Reference in New Issue
Block a user