From c6e9a101aec2a49fc47bcd5dbdd5763d043be2aa Mon Sep 17 00:00:00 2001 From: Nick Novitski Date: Wed, 18 Oct 2023 22:11:13 -0700 Subject: [PATCH] feat: Don't add nonexistent directories to PATH --- nix-develop-gha.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nix-develop-gha.sh b/nix-develop-gha.sh index 3e6950e..79ffa1e 100755 --- a/nix-develop-gha.sh +++ b/nix-develop-gha.sh @@ -50,5 +50,8 @@ for ((i = ${#nix_path_array[@]} - 1; i >= 0; i--)); do if contains "$nix_path_entry" "$PATH"; then continue fi + if ! [ -d "$nix_path_entry" ]; then + continue + fi echo "$nix_path_entry" >>"${GITHUB_PATH:-/dev/stderr}" done