Explorar o código

read from os executable

Bruce MacDonald hai 1 ano
pai
achega
50e87c6691
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      cmd/cmd.go

+ 5 - 1
cmd/cmd.go

@@ -527,7 +527,11 @@ func RunServer(_ *cobra.Command, _ []string) error {
 }
 }
 
 
 func startMacApp(client *api.Client) error {
 func startMacApp(client *api.Client) error {
-	link, err := os.Readlink("/usr/local/bin/ollama")
+	exe, err := os.Executable()
+	if err != nil {
+		return err
+	}
+	link, err := os.Readlink(exe)
 	if err != nil {
 	if err != nil {
 		return err
 		return err
 	}
 	}