From 0bac448ac6e29404f938868a4a379dc07bf68abc Mon Sep 17 00:00:00 2001 From: xZero707 Date: Mon, 2 Jun 2025 01:11:57 +0200 Subject: [PATCH] Add error handling if infisical-dcli is used --- dist/scripts/src/fetch-secrets.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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