Skip to content

Commit 0729817

Browse files
committed
code review fixes
1 parent 4487aa0 commit 0729817

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

packages/nextjs/vercel/install-sentry-from-branch.sh

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,15 @@ PACKAGES_DIR="$REPO_DIR/packages"
4343
# Escape all of the slashes in the path for use in sed
4444
ESCAPED_PACKAGES_DIR=$(echo $PACKAGES_DIR | sed s/'\/'/'\\\/'/g)
4545

46-
# Get the names of all of the packages
47-
package_names=()
48-
for abs_package_path in ${PACKAGES_DIR}/*; do
49-
package_names+=($(basename $abs_package_path))
50-
done
46+
PACKAGE_NAMES=$(ls PACKAGES_DIR)
5147

5248
# Modify each package's package.json file by searching in it for sentry dependencies from the monorepo and, for each
5349
# sibling dependency found, replacing the version number with a file dependency pointing to the sibling itself (so
5450
# `"@sentry/utils": "6.9.0"` becomes `"@sentry/utils": "file:/abs/path/to/sentry-javascript/packages/utils"`)
55-
for package in ${package_names[@]}; do
56-
cd ${PACKAGES_DIR}/${package}
57-
51+
for package in $PACKAGE_NAMES; do
5852
# Within a given package.json file, search for each of the other packages in turn, and if found, make the replacement
59-
for package_dep in ${package_names[@]}; do
60-
sed -Ei /"@sentry\/${package_dep}"/s/"[0-9]+\.[0-9]+\.[0-9]+"/"file:${ESCAPED_PACKAGES_DIR}\/${package_dep}"/ package.json
53+
for package_dep in $PACKAGE_NAMES; do
54+
sed -Ei /"@sentry\/${package_dep}"/s/"[0-9]+\.[0-9]+\.[0-9]+"/"file:${ESCAPED_PACKAGES_DIR}\/${package_dep}"/ ${PACKAGES_DIR}/${package}/package.json
6155
done
6256
done
6357

0 commit comments

Comments
 (0)