diff --git a/dist/scripts/src/fetch-secrets.sh b/dist/scripts/src/fetch-secrets.sh index 4dc593b..51e8d89 100755 --- a/dist/scripts/src/fetch-secrets.sh +++ b/dist/scripts/src/fetch-secrets.sh @@ -26,7 +26,10 @@ fetch_secret() { if command -v infisical-dcli &>/dev/null; then # If infisical CLI command is available, use it directly - infisical-dcli "${args[@]}" >"${output_file}" + if ! infisical-dcli "${args[@]}" >"${output_file}"; then + rm -f "${output_file}" # Clean up if fetch failed + return 1 + fi else if ! dc_infisical "${args[@]}" >"${output_file}"; then rm -f "${output_file}" # Clean up if fetch failed