Skip to content

Commit 7eb1786

Browse files
fix copy options json only if destination set and file exists
1 parent dcfdc6c commit 7eb1786

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/core/scripts/sentry-xcode.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,10 @@ if [ "$SENTRY_COPY_OPTIONS_FILE" = true ]; then
6363
echo "[Sentry] CONFIGURATION_BUILD_DIR is not set. $SENTRY_OPTIONS_FILE_ERROR_MESSAGE_POSTFIX" 1>&2
6464
elif [[ -z "$UNLOCALIZED_RESOURCES_FOLDER_PATH" ]]; then
6565
echo "[Sentry] UNLOCALIZED_RESOURCES_FOLDER_PATH is not set. $SENTRY_OPTIONS_FILE_ERROR_MESSAGE_POSTFIX" 1>&2
66-
fi
67-
68-
if [ -f "$SENTRY_OPTIONS_FILE_PATH" ]; then
66+
elif [ ! -f "$SENTRY_OPTIONS_FILE_PATH" ]; then
67+
echo "[Sentry] $SENTRY_OPTIONS_FILE_PATH not found. $SENTRY_OPTIONS_FILE_ERROR_MESSAGE_POSTFIX" 1>&2
68+
else
6969
cp "$SENTRY_OPTIONS_FILE_PATH" "$SENTRY_OPTIONS_FILE_DESTINATION_PATH"
7070
echo "[Sentry] Copied $SENTRY_OPTIONS_FILE_PATH to $SENTRY_OPTIONS_FILE_DESTINATION_PATH"
71-
else
72-
echo "[Sentry] $SENTRY_OPTIONS_FILE_PATH not found. $SENTRY_OPTIONS_FILE_ERROR_MESSAGE_POSTFIX" 1>&2
7371
fi
7472
fi

0 commit comments

Comments
 (0)