mirror of
https://github.com/instructkr/claw-code.git
synced 2026-11-17 00:00:00 +08:00
perf(test): cache bash probe resolution per session with functools.lru_cache
This commit is contained in:
1 parent
0d8b50b378
commit
a916bf9d66
2 files changed
+8
-5
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import functools
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
@@ -5,6 +6,7 @@ import unittest
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
@functools.lru_cache(maxsize=1)
|
||||
def get_bash_executable() -> str | None:
|
||||
if os.name == 'nt':
|
||||
for candidate in (
|
||||
@@ -21,6 +23,7 @@ def get_bash_executable() -> str | None:
|
||||
return None
|
||||
|
||||
|
||||
@functools.lru_cache(maxsize=1)
|
||||
def require_bash() -> bool:
|
||||
bash = get_bash_executable()
|
||||
if not bash:
|
||||
|
||||
Reference in new issue
Block a user