Skip to content

Commit b8e50d8

Browse files
committed
Old bash compat
1 parent f3bd8c0 commit b8e50d8

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

tools/run_nix_shell.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,20 @@ else
9898
fi
9999

100100
# map script variables to action inputs (see action.yaml)
101-
declare -A INPUTS=(
102-
["derivation-path"]="${derivation_path:-}"
103-
["options"]="$options"
104-
["pure"]="$pure"
105-
["run"]="$script"
106-
["shell-flags"]="${shell_flags:-}"
107-
["verbose"]="$verbose"
108-
["working-directory"]="${cwd:-}"
101+
declare -a INPUTS=(
102+
derivation-path "${derivation_path:-}"
103+
options "$options"
104+
pure "$pure"
105+
run "$script"
106+
shell-flags "${shell_flags:-}"
107+
verbose "$verbose"
108+
working-directory "${cwd:-}"
109109
)
110110

111-
declare -a variables=()
111+
for ((i=0; i < ${#INPUTS[@]}; i+=2)); do
112+
name="${INPUTS[i]}"
113+
value="${INPUTS[i+1]}"
112114

113-
for name in "${!INPUTS[@]}"; do
114-
value="${INPUTS[$name]}"
115115
if [[ -n "$value" ]]; then
116116
input="INPUT_${name^^}" # prefix with INPUT_ and uppercase
117117
input="${input// /_}" # replace spaces with underscores

0 commit comments

Comments
 (0)