fix: add build dir to PATH in nix-shell; robust SSH PATH detection in check_ssh_localhost

This commit is contained in:
2026-07-06 20:30:38 +02:00
parent a96d48f0ed
commit 1a12484469
2 changed files with 14 additions and 6 deletions
+1
View File
@@ -20,5 +20,6 @@ pkgs.mkShell {
shellHook = ''
export NIX_ENFORCE_PURITY=0
cmake -B build
export PATH="$PWD/build:$PATH"
'';
}
+13 -6
View File
@@ -382,12 +382,19 @@ def check_ssh_localhost():
"localhost", "which", "fastsync-server"],
capture_output=True, timeout=10)
if r.returncode != 0:
install = subprocess.run(["ssh", "-o", "BatchMode=yes", "localhost",
f"mkdir -p ~/.local/bin && ln -sf {server_path} ~/.local/bin/fastsync-server"],
capture_output=True, timeout=10)
if install.returncode == 0:
r = subprocess.run(["ssh", "-o", "BatchMode=yes", "localhost",
"which", "fastsync-server"], capture_output=True, timeout=10)
path_r = subprocess.run(
["ssh", "-o", "BatchMode=yes", "localhost",
"echo $PATH | tr ':' '\\n' | while read d; do [ -w \"$d\" ] && echo \"$d\" && break; done"],
capture_output=True, timeout=10, text=True)
remote_bin_dir = path_r.stdout.strip()
if remote_bin_dir:
install = subprocess.run(
["ssh", "-o", "BatchMode=yes", "localhost",
f"ln -sf {server_path} {remote_bin_dir}/fastsync-server"],
capture_output=True, timeout=10)
if install.returncode == 0:
r = subprocess.run(["ssh", "-o", "BatchMode=yes", "localhost",
"which", "fastsync-server"], capture_output=True, timeout=10)
SSH_AVAILABLE = r.returncode == 0