cleaning up
This commit is contained in:
parent
7b8e003ca5
commit
e41e30f3c6
|
|
@ -48,7 +48,6 @@
|
|||
"electron": "25.2.0",
|
||||
"eslint": "^8.43.0",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"file-loader": "^6.2.0",
|
||||
"fork-ts-checker-webpack-plugin": "^7.3.0",
|
||||
"node-loader": "^2.0.0",
|
||||
"postcss": "^8.4.24",
|
||||
|
|
@ -8655,6 +8654,8 @@
|
|||
"resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.2.0.tgz",
|
||||
"integrity": "sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"loader-utils": "^2.0.0",
|
||||
"schema-utils": "^3.0.0"
|
||||
|
|
|
|||
|
|
@ -11,25 +11,27 @@ const ollama = app.isPackaged
|
|||
? path.join(process.resourcesPath, 'ollama')
|
||||
: path.resolve(process.cwd(), '..', 'ollama')
|
||||
|
||||
function installCLI() {
|
||||
function installCLI(callback: () => void) {
|
||||
const symlinkPath = '/usr/local/bin/ollama'
|
||||
|
||||
if (fs.existsSync(symlinkPath) && fs.readlinkSync(symlinkPath) === ollama) {
|
||||
callback && callback()
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
const command = `
|
||||
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) => {
|
||||
if (error) {
|
||||
console.error(`cli: failed to install cli: ${error.message}`)
|
||||
callback && callback()
|
||||
return
|
||||
}
|
||||
|
||||
console.info(stdout)
|
||||
console.error(stderr)
|
||||
callback && callback()
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -72,8 +74,10 @@ export default function () {
|
|||
<button
|
||||
onClick={() => {
|
||||
// install the command line
|
||||
installCLI()
|
||||
setStep(2)
|
||||
installCLI(() => {
|
||||
window.focus()
|
||||
setStep(2)
|
||||
})
|
||||
}}
|
||||
className='mx-auto w-[60%] rounded-dm rounded-md bg-black px-4 py-2 text-sm text-white hover:brightness-110'
|
||||
>
|
||||
|
|
|
|||
|
|
@ -60,10 +60,9 @@ function firstRunWindow() {
|
|||
|
||||
if (process.platform === 'darwin') {
|
||||
app.dock.hide()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function createSystemtray() {
|
||||
let iconPath = path.join(__dirname, '..', '..', 'assets', 'ollama_icon_16x16Template.png')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue