File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ warn() {
1010
1111pi_home=" ${PI_HOME:- $HOME / .pi/ agent} "
1212repo_root=" $( git rev-parse --show-toplevel 2> /dev/null || pwd) "
13+ host_name=" $( hostname -s 2> /dev/null || hostname) "
14+ host_name=" ${host_name%% .* } "
1315
1416if [ ! -d " $pi_home " ]; then
1517 warn " Pi home not found at $pi_home ; run hey re before using pi."
3739
3840if command -v pi > /dev/null 2>&1 ; then
3941 current_version=" $( pi --version 2> /dev/null || true) "
40- pinned_version=" $( nix eval --no-write-lock-file --raw " $repo_root #nixosConfigurations.$( hostname) .pkgs.llm-agents.pi.version" 2> /dev/null || true) "
42+ pinned_version=" "
43+ for flake_attr in \
44+ " darwinConfigurations.$host_name .pkgs.llm-agents.pi.version" \
45+ " nixosConfigurations.$host_name .pkgs.llm-agents.pi.version"
46+ do
47+ pinned_version=" $( nix eval --no-write-lock-file --raw " $repo_root #$flake_attr " 2> /dev/null || true) "
48+ [ -n " $pinned_version " ] && break
49+ done
50+
51+ if [ -n " $current_version " ] && [ -z " $pinned_version " ]; then
52+ warn " Could not resolve repo-pinned Pi version for host '$host_name '."
53+ fi
54+
4155 if [ -n " $current_version " ] && [ -n " $pinned_version " ] && [ " $current_version " != " $pinned_version " ]; then
4256 warn " Pi binary version $current_version differs from repo-pinned $pinned_version ; run hey re."
4357 fi
You can’t perform that action at this time.
0 commit comments