app: dont advance on error

This commit is contained in:
Jeffrey Morgan 2023-07-26 10:46:43 -04:00
parent dc642aa07d
commit c48f07f821
2 changed files with 10 additions and 10 deletions

View file

@ -51,10 +51,15 @@ export default function () {
<div className='mx-auto'> <div className='mx-auto'>
<button <button
onClick={async () => { onClick={async () => {
await install() try {
getCurrentWindow().show() await install()
getCurrentWindow().focus() setStep(Step.FINISH)
setStep(Step.FINISH) } catch (e) {
console.error('could not install: ', e)
} finally {
getCurrentWindow().show()
getCurrentWindow().focus()
}
}} }}
className='no-drag rounded-dm mx-auto w-[60%] rounded-md bg-black px-4 py-2 text-sm text-white hover:brightness-110' className='no-drag rounded-dm mx-auto w-[60%] rounded-md bg-black px-4 py-2 text-sm text-white hover:brightness-110'
> >

View file

@ -17,10 +17,5 @@ export async function install() {
symlinkPath symlinkPath
)} && ln -F -s ${ollama} ${symlinkPath}" with administrator privileges` )} && ln -F -s ${ollama} ${symlinkPath}" with administrator privileges`
try { await exec(`osascript -e '${command}'`)
await exec(`osascript -e '${command}'`)
} catch (error) {
console.error(`cli: failed to install cli: ${error.message}`)
return
}
} }