Move ollama executable out of bin dir (#6535)
release / build-darwin (push) Has been cancelled
release / generate-windows-cpu (push) Has been cancelled
release / generate-windows-rocm (push) Has been cancelled
release / generate-windows-cuda (map[url:https://developer.download.nvidia.com/compute/cuda/11.3.1/local_installers/cuda_11.3.1_465.89_win10.exe version:11]) (push) Has been cancelled
release / generate-windows-cuda (map[url:https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_551.61_windows.exe version:12]) (push) Has been cancelled
release / build-linux-amd64 (push) Has been cancelled
release / build-linux-arm64 (push) Has been cancelled
release / build-windows (push) Has been cancelled
release / release (push) Has been cancelled

This commit is contained in:
Daniel Hiltgen
2024-08-27 16:19:00 -07:00
committed by GitHub
parent d13c3daa0b
commit 93ea9240ae
6 changed files with 21 additions and 10 deletions
+10 -1
View File
@@ -190,7 +190,7 @@ func RunnersDir() (p string) {
}
var paths []string
for _, root := range []string{filepath.Dir(exe), filepath.Join(filepath.Dir(exe), ".."), cwd} {
for _, root := range []string{filepath.Dir(exe), filepath.Join(filepath.Dir(exe), LibRelativeToExe()), cwd} {
paths = append(paths,
root,
filepath.Join(root, runtime.GOOS+"-"+runtime.GOARCH),
@@ -282,3 +282,12 @@ func Values() map[string]string {
func Var(key string) string {
return strings.Trim(strings.TrimSpace(os.Getenv(key)), "\"'")
}
// On windows, we keep the binary at the top directory, but
// other platforms use a "bin" directory, so this returns ".."
func LibRelativeToExe() string {
if runtime.GOOS == "windows" {
return "."
}
return ".."
}