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
0833f5af
Commit
0833f5af
authored
Jul 06, 2023
by
Jeffrey Morgan
Browse files
tweak CLI install text
parent
03eca6ea
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
app/src/index.ts
app/src/index.ts
+10
-4
No files found.
app/src/index.ts
View file @
0833f5af
import
{
app
,
BrowserWindow
,
autoUpdater
,
dialog
}
from
'
electron
'
import
{
app
,
BrowserWindow
,
autoUpdater
,
dialog
}
from
'
electron
'
import
{
spawn
,
exec
}
from
'
child_process
'
import
{
spawn
,
exec
}
from
'
child_process
'
import
*
as
path
from
'
path
'
import
*
as
path
from
'
path
'
import
*
as
fs
from
'
fs
'
require
(
'
@electron/remote/main
'
).
initialize
()
require
(
'
@electron/remote/main
'
).
initialize
()
...
@@ -57,11 +58,17 @@ if (app.isPackaged) {
...
@@ -57,11 +58,17 @@ if (app.isPackaged) {
}
}
function
installCLI
()
{
function
installCLI
()
{
const
symlinkPath
=
'
/usr/local/bin/ollama
'
if
(
fs
.
existsSync
(
symlinkPath
)
&&
fs
.
readlinkSync
(
symlinkPath
)
===
ollama
)
{
return
}
dialog
dialog
.
showMessageBox
({
.
showMessageBox
({
type
:
'
info
'
,
type
:
'
info
'
,
title
:
'
Ollama CLI installation
'
,
title
:
'
Ollama CLI installation
'
,
message
:
'
To install the
o
llama CLI, we need
your permission. You will be prompted to confirm
.
'
,
message
:
'
To install the
O
llama CLI, we need
to ask you for administrator privileges
.
'
,
buttons
:
[
'
OK
'
],
buttons
:
[
'
OK
'
],
})
})
.
then
(
result
=>
{
.
then
(
result
=>
{
...
@@ -69,7 +76,6 @@ function installCLI() {
...
@@ -69,7 +76,6 @@ function installCLI() {
let
command
=
`
let
command
=
`
do shell script "ln -F -s
${
ollama
}
/usr/local/bin/ollama" with administrator privileges
do shell script "ln -F -s
${
ollama
}
/usr/local/bin/ollama" with administrator privileges
`
`
exec
(
`osascript -e '
${
command
}
'`
,
(
error
:
Error
|
null
,
stdout
:
string
,
stderr
:
string
)
=>
{
exec
(
`osascript -e '
${
command
}
'`
,
(
error
:
Error
|
null
,
stdout
:
string
,
stderr
:
string
)
=>
{
if
(
error
)
{
if
(
error
)
{
console
.
error
(
`exec error:
${
error
}
`
)
console
.
error
(
`exec error:
${
error
}
`
)
...
...
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