Skip to content

Conversation

@jaskfla
Copy link
Contributor

@jaskfla jaskfla commented Jan 14, 2025

Found that the downloadEnvironmentVariables.sh script wasn’t working. #5568 previously made modifications to the script (though hasn't been merged)

I used that as a starting point to fix up the script

Comment on lines -75 to +78
has_example_env_in_package=$(find $DIR/../../packages/$PACKAGE -type f -name '*.env.example' | wc -l)
if [ $has_example_env_in_package -eq 1 ]; then
load_env_file_from_bw $PACKAGE $DIR/../../packages/$PACKAGE ""
for PACKAGE in "${PACKAGES[@]}"; do
# Only download the env file if there is an example file in the package. If there isnt, this
# means it is a package that doesn’t need env vars
if [[ -f $REPO_ROOT/packages/$PACKAGE/.env.example ]]; then
Copy link
Contributor Author

@jaskfla jaskfla Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much more direct way of checking for existence of a file, and saves spinning up a child process for find

Could also have been [[ ]] && load_env_file..., but the if is a bit more explicit

@jaskfla jaskfla merged commit 0e025a4 into dev Jan 15, 2025
44 checks passed
@jaskfla jaskfla deleted the fix-env-var-script branch January 15, 2025 21:56
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.

2 participants