homebrew path (#344)

This commit is contained in:
Sander Land authored and GitHub committed 2021-01-28 15:58:29 +01:00
1 parent e156fea09c
commit 34b3f92d20
3 files changed
+10 -6

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
PROGRAM_NAME = "KaTrain"
VERSION = "1.7.5"
VERSION = "1.7.6"
HOMEPAGE = "https://github.com/sanderland/katrain"
CONFIG_MIN_VERSION = "1.7.0" # keep config files from this version
ANALYSIS_FORMAT_VERSION = "1.0"
+7 -5
View File
@@ -79,11 +79,13 @@ class KataGoEngine:
if exepath and not os.path.isfile(exe):
self.katrain.log(i18n._("Kata exe not found").format(exe=exe), OUTPUT_ERROR)
return # don't start
elif not exepath and not any(
os.path.isfile(os.path.join(path, exe)) for path in os.environ.get("PATH", "").split(os.pathsep)
):
self.katrain.log(i18n._("Kata exe not found in path").format(exe=exe), OUTPUT_ERROR)
return # don't start
elif not exepath:
paths = os.getenv("PATH", ".").split(os.pathsep) + ["/opt/homebrew/bin/"]
exe_with_paths = [os.path.join(path, exe) for path in paths if os.path.isfile(os.path.join(path, exe))]
if not exe_with_paths:
self.katrain.log(i18n._("Kata exe not found in path").format(exe=exe), OUTPUT_ERROR)
return # don't start
exe = exe_with_paths[0]
elif not os.path.isfile(model):
self.katrain.log(i18n._("Kata model not found").format(model=model), OUTPUT_ERROR)
return # don't start