launchdarkly / ld-find-code-refs

Build tool for automatically sending feature flag code references to LaunchDarkly
https://launchdarkly.com
Other
46 stars 34 forks source link

find-code-references job crashes if `$BASH_ENV` file doesn't exist #322

Closed azenk closed 1 year ago

azenk commented 1 year ago

The fix for #311 merged in #312 seems to cause our jobs to fail when the $BASH_ENV file doesn't exist. Checking if the file exists before sourcing it should fix the issue.

Job output:

#!/bin/sh -eo pipefail
source $BASH_ENV || true
ld-find-code-refs \
<snip/>

/bin/sh: source: line 0: can't open '/tmp/.bash_env-63d2c5e4c3db6d5bab2029eb-0-build': No such file or directory

Exited with code exit status 2

CircleCI received exit code 2
jazanne commented 1 year ago

@azenk thank you for reporting this bug and sorry for the inconvenience. We'll have the team look into a fix.