diff --git a/app/js/index.js b/app/js/index.js index 280e8556..8c2ca1df 100644 --- a/app/js/index.js +++ b/app/js/index.js @@ -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({ diff --git a/app/js/templates.js b/app/js/templates.js index 7a806999..8861b3e2 100644 --- a/app/js/templates.js +++ b/app/js/templates.js @@ -38,5 +38,10 @@ gitlit.templates = { Refresh - `) + `), + isNoGitLfsRepo: ejs.compile(` +
+ <%= repoDir %> is not a git lfs repo. +
+ `) }; diff --git a/app/main.js b/app/main.js index f373f90e..4ec704c7 100644 --- a/app/main.js +++ b/app/main.js @@ -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 = [];