Skip to content

Commit 49a61ca

Browse files
authored
Support bash 3.x in our evals setup script (#2248)
1 parent 71bdd72 commit 49a61ca

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

evals/scripts/setup.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
22

33
menu() {
44
echo -e "\n📋 Which eval types would you like to support?\n"
@@ -16,6 +16,14 @@ menu() {
1616
echo -e " q) quit\n"
1717
}
1818

19+
has_asdf_plugin() {
20+
local plugin="$1"
21+
case "$plugin" in
22+
nodejs|python|golang|rust) echo "true" ;;
23+
*) echo "false" ;;
24+
esac
25+
}
26+
1927
build_extension() {
2028
echo "🔨 Building the Roo Code extension..."
2129
cd ..
@@ -36,9 +44,6 @@ fi
3644
options=("nodejs" "python" "golang" "rust" "java")
3745
binaries=("node" "python" "go" "rustc" "javac")
3846

39-
declare -A has_asdf_plugin
40-
has_asdf_plugin=([nodejs]=true [python]=true [golang]=true [rust]=true [java]=false)
41-
4247
for i in "${!options[@]}"; do
4348
choices[i]="*"
4449
done
@@ -163,7 +168,7 @@ for i in "${!options[@]}"; do
163168
plugin="${options[$i]}"
164169
binary="${binaries[$i]}"
165170

166-
if [[ "${has_asdf_plugin[$plugin]}" == "true" ]]; then
171+
if [[ "$(has_asdf_plugin "$plugin")" == "true" ]]; then
167172
if ! asdf plugin list | grep -q "^${plugin}$" && ! command -v "${binary}" &>/dev/null; then
168173
echo "📦 Installing ${plugin} asdf plugin..."
169174
asdf plugin add "${plugin}" || exit 1

0 commit comments

Comments
 (0)