Skip to content

Conversation

@lobsterkatie
Copy link
Member

It turns out that bash and zsh handle for-loops differently. Consider the following code:

animals=("aardvark" "baboon" "coati")

echo -e "\nno indexing:"
for animal in $animals; do
  echo $animal
done

echo -e "\nwith indexing:"
for animal in ${animals[@]}; do
  echo $animal
done

In zsh, you get two copies of the full list:

> source indexing-test.sh

no indexing:
aardvark
baboon
coati

with indexing:
aardvark
baboon
coati

In bash, however, if you don't index, you only get the first element:

> source indexing-test.sh 

no indexing:
aardvark

with indexing:
aardvark
baboon
coati

Since the install-sentry-from-branch.sh script runs under bash (on vercel), we need to index in order for our for-loops to work.

@github-actions
Copy link
Contributor

size-limit report

Path Size
@sentry/browser - CDN Bundle (gzipped) 21.46 KB (0%)
@sentry/browser - Webpack 22.47 KB (0%)
@sentry/react - Webpack 22.5 KB (0%)
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 28.97 KB (-0.01% 🔽)

@lobsterkatie lobsterkatie merged commit 61a22ec into master Jul 20, 2021
@lobsterkatie lobsterkatie deleted the kmclb-nextjs-vercel-script-indexing-in-for-loops branch July 20, 2021 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants