File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,9 +43,12 @@ if [ -z "$SENTRY_CLI_EXECUTABLE" ]; then
4343 PNPM_BIN_PATH=" $PWD /../node_modules/@sentry/react-native/node_modules/.bin/sentry-cli"
4444
4545 if [ -f " $PNPM_BIN_PATH " ]; then
46- FIRST_NODE_PATH=$( grep -oE ' NODE_PATH="[^"]+"' " $PNPM_BIN_PATH " | head -n1 | sed -E ' s/^NODE_PATH="([^":]+).*/\1/' )
47- if [ -n " $FIRST_NODE_PATH " ]; then
48- SENTRY_CLI_PACKAGE_PATH=" ${FIRST_NODE_PATH%/ node_modules} /bin/sentry-cli"
46+ NODE_PATH_VALUE=$( grep -oE ' NODE_PATH="[^"]+"' " $PNPM_BIN_PATH " | head -n1 | sed -E ' s/^NODE_PATH="([^"]*)"/\1/' )
47+ # Strip everything from the first `@sentry/cli/` onwards. If `%%` finds no match
48+ # PREFIX equals NODE_PATH_VALUE and we leave SENTRY_CLI_PACKAGE_PATH unset.
49+ SENTRY_CLI_PREFIX=" ${NODE_PATH_VALUE%%@ sentry/ cli/* } "
50+ if [ -n " $NODE_PATH_VALUE " ] && [ " $SENTRY_CLI_PREFIX " != " $NODE_PATH_VALUE " ]; then
51+ SENTRY_CLI_PACKAGE_PATH=" ${SENTRY_CLI_PREFIX} @sentry/cli/bin/sentry-cli"
4952 fi
5053 fi
5154 fi
Original file line number Diff line number Diff line change @@ -38,9 +38,12 @@ if [ -z "$SENTRY_CLI_EXECUTABLE" ]; then
3838 PNPM_BIN_PATH=" $PWD /../node_modules/@sentry/react-native/node_modules/.bin/sentry-cli"
3939
4040 if [ -f " $PNPM_BIN_PATH " ]; then
41- FIRST_NODE_PATH=$( grep -oE ' NODE_PATH="[^"]+"' " $PNPM_BIN_PATH " | head -n1 | sed -E ' s/^NODE_PATH="([^":]+).*/\1/' )
42- if [ -n " $FIRST_NODE_PATH " ]; then
43- SENTRY_CLI_PACKAGE_PATH=" ${FIRST_NODE_PATH%/ node_modules} /bin/sentry-cli"
41+ NODE_PATH_VALUE=$( grep -oE ' NODE_PATH="[^"]+"' " $PNPM_BIN_PATH " | head -n1 | sed -E ' s/^NODE_PATH="([^"]*)"/\1/' )
42+ # Strip everything from the first `@sentry/cli/` onwards. If `%%` finds no match
43+ # PREFIX equals NODE_PATH_VALUE and we leave SENTRY_CLI_PACKAGE_PATH unset.
44+ SENTRY_CLI_PREFIX=" ${NODE_PATH_VALUE%%@ sentry/ cli/* } "
45+ if [ -n " $NODE_PATH_VALUE " ] && [ " $SENTRY_CLI_PREFIX " != " $NODE_PATH_VALUE " ]; then
46+ SENTRY_CLI_PACKAGE_PATH=" ${SENTRY_CLI_PREFIX} @sentry/cli/bin/sentry-cli"
4447 fi
4548 fi
4649 fi
You can’t perform that action at this time.
0 commit comments