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
orangecat
ollama
Commits
dbb3174c
Commit
dbb3174c
authored
Jul 27, 2023
by
Jeffrey Morgan
Browse files
app: fix #218 and keep dock open on install
parent
31673d26
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
app/src/app.tsx
app/src/app.tsx
+6
-1
app/src/index.ts
app/src/index.ts
+5
-4
app/src/install.ts
app/src/install.ts
+1
-1
No files found.
app/src/app.tsx
View file @
dbb3174c
...
...
@@ -2,7 +2,7 @@ import { useState } from 'react'
import
copy
from
'
copy-to-clipboard
'
import
{
CheckIcon
,
DocumentDuplicateIcon
}
from
'
@heroicons/react/24/outline
'
import
Store
from
'
electron-store
'
import
{
getCurrentWindow
}
from
'
@electron/remote
'
import
{
getCurrentWindow
,
app
}
from
'
@electron/remote
'
import
{
install
}
from
'
./install
'
import
OllamaIcon
from
'
./ollama.svg
'
...
...
@@ -107,6 +107,11 @@ export default function () {
<
button
onClick
=
{
()
=>
{
store
.
set
(
'
first-time-run
'
,
true
)
if
(
process
.
platform
===
'
darwin
'
)
{
app
.
dock
.
hide
()
}
window
.
close
()
}
}
className
=
'no-drag rounded-dm mx-auto w-[60%] rounded-md bg-black px-4 py-2 text-sm text-white hover:brightness-110'
...
...
app/src/index.ts
View file @
dbb3174c
...
...
@@ -36,6 +36,7 @@ app.on('ready', () => {
const
gotTheLock
=
app
.
requestSingleInstanceLock
()
if
(
!
gotTheLock
)
{
app
.
exit
(
0
)
return
}
app
.
on
(
'
second-instance
'
,
()
=>
{
...
...
@@ -56,10 +57,6 @@ app.on('ready', () => {
init
()
})
if
(
process
.
platform
===
'
darwin
'
)
{
app
.
dock
.
hide
()
}
function
firstRunWindow
()
{
// Create the browser window.
welcomeWindow
=
new
BrowserWindow
({
...
...
@@ -198,6 +195,10 @@ function init() {
server
()
if
(
store
.
get
(
'
first-time-run
'
)
&&
installed
())
{
if
(
process
.
platform
===
'
darwin
'
)
{
app
.
dock
.
hide
()
}
app
.
setLoginItemSettings
({
openAtLogin
:
app
.
getLoginItemSettings
().
openAtLogin
})
return
}
...
...
app/src/install.ts
View file @
dbb3174c
...
...
@@ -15,7 +15,7 @@ export function installed() {
export
async
function
install
()
{
const
command
=
`do shell script "mkdir -p
${
path
.
dirname
(
symlinkPath
)}
&& ln -F -s
${
ollama
}
${
symlinkPath
}
" with administrator privileges`
)}
&& ln -F -s
\\"
${
ollama
}
\\" \\"
${
symlinkPath
}
\\"
" with administrator privileges`
await
exec
(
`osascript -e '
${
command
}
'`
)
}
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