Add error handling if infisical-dcli is used

This commit is contained in:
2025-06-02 01:11:57 +02:00
parent 9de315bd7b
commit 0bac448ac6

View File

@@ -26,7 +26,10 @@ fetch_secret() {
if command -v infisical-dcli &>/dev/null; then if command -v infisical-dcli &>/dev/null; then
# If infisical CLI command is available, use it directly # 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 else
if ! dc_infisical "${args[@]}" >"${output_file}"; then if ! dc_infisical "${args[@]}" >"${output_file}"; then
rm -f "${output_file}" # Clean up if fetch failed rm -f "${output_file}" # Clean up if fetch failed