Skip to content

Commit fd0cb79

Browse files
committed
fix(devbox): make infisical setup prompts explicit
1 parent 05aef7f commit fd0cb79

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

scripts/secrets/configure-infisical-devbox.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ prompt_value() {
4444
printf '%s: ' "$label" >&2
4545
fi
4646

47-
IFS= read -r value
47+
if ! IFS= read -r value; then
48+
fail "could not read $label from terminal"
49+
fi
4850
if [ -z "$value" ]; then
4951
value="$default_value"
5052
fi
@@ -59,7 +61,11 @@ prompt_secret() {
5961
printf '%s: ' "$label" >&2
6062
old_stty="$(stty -g)"
6163
stty -echo
62-
IFS= read -r value
64+
if ! IFS= read -r value; then
65+
stty "$old_stty"
66+
printf '\n' >&2
67+
fail "could not read $label from terminal"
68+
fi
6369
stty "$old_stty"
6470
printf '\n' >&2
6571
printf '%s' "$value"
@@ -136,6 +142,8 @@ load_if_present "$config_path"
136142
unset INFISICAL_MACHINE_IDENTITY INFISICAL_CLIENT_ID INFISICAL_CLIENT_SECRET
137143
load_if_present "$machine_config_path"
138144

145+
printf 'Configuring Infisical devbox machine auth. Press Enter to accept defaults.\n' >&2
146+
139147
infisical_domain="$(prompt_value "Infisical domain" "${INFISICAL_DOMAIN:-https://eu.infisical.com/api}")"
140148
infisical_project_id="$(prompt_value "Infisical project ID" "${INFISICAL_PROJECT_ID:-}")"
141149
infisical_env="$(prompt_value "Infisical env" "${INFISICAL_ENV:-dev}")"

0 commit comments

Comments
 (0)