Skip to content

Commit 89d91c5

Browse files
committed
fix(core): pass options paths as node args in xcode script
1 parent 77e5915 commit 89d91c5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/core/scripts/sentry-xcode.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,12 @@ if [ "$SENTRY_COPY_OPTIONS_FILE" = true ]; then
103103
if [ -n "$SENTRY_ENVIRONMENT" ]; then
104104
if "$LOCAL_NODE_BINARY" -e "
105105
var fs = require('fs');
106-
var opts = JSON.parse(fs.readFileSync('$SENTRY_OPTIONS_FILE_PATH', 'utf8'));
106+
var sourcePath = process.argv[1];
107+
var destinationPath = process.argv[2];
108+
var opts = JSON.parse(fs.readFileSync(sourcePath, 'utf8'));
107109
opts.environment = process.env.SENTRY_ENVIRONMENT;
108-
fs.writeFileSync('$SENTRY_OPTIONS_FILE_DESTINATION_PATH', JSON.stringify(opts));
109-
" 2>/dev/null; then
110+
fs.writeFileSync(destinationPath, JSON.stringify(opts));
111+
" -- "$SENTRY_OPTIONS_FILE_PATH" "$SENTRY_OPTIONS_FILE_DESTINATION_PATH" 2>/dev/null; then
110112
echo "[Sentry] Overriding 'environment' from SENTRY_ENVIRONMENT environment variable"
111113
else
112114
echo "[Sentry] Failed to override environment, copying file as-is." 1>&2

0 commit comments

Comments
 (0)