Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
594f07d7
Commit
594f07d7
authored
Jun 27, 2023
by
Jeffrey Morgan
Browse files
add auto update check
parent
f482d80c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
desktop/src/index.ts
desktop/src/index.ts
+15
-1
No files found.
desktop/src/index.ts
View file @
594f07d7
import
{
app
,
BrowserWindow
,
autoUpdater
}
from
'
electron
'
import
{
app
,
BrowserWindow
,
autoUpdater
,
dialog
}
from
'
electron
'
import
{
spawn
}
from
'
child_process
'
import
*
as
path
from
'
path
'
...
...
@@ -87,3 +87,17 @@ autoUpdater.setFeedURL({ url: `https://updates.ollama.ai/update/${process.platfo
setInterval
(()
=>
{
autoUpdater
.
checkForUpdates
()
},
60000
)
autoUpdater
.
on
(
'
update-downloaded
'
,
(
event
,
releaseNotes
,
releaseName
)
=>
{
dialog
.
showMessageBox
({
type
:
'
info
'
,
buttons
:
[
'
Restart Now
'
,
'
Later
'
],
title
:
'
New update available
'
,
message
:
process
.
platform
===
'
win32
'
?
releaseNotes
:
releaseName
,
detail
:
'
A new version of Ollama is available. Restart to apply the update.
'
,
})
.
then
(
returnValue
=>
{
if
(
returnValue
.
response
===
0
)
autoUpdater
.
quitAndInstall
()
})
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment