-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix unbound variable error #1663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
``` remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/ruby.tgz remote: /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/bin/detect: line 12: BUILD_DIR: unbound variable remote: /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/bin/detect: line 12: output::error: command not found ```
``` ANSI_YELLOW='\033[1;33m' ^---------^ SC2034 (warning): ANSI_YELLOW appears unused. Verify use (or export if used externally). ANSI_BLUE='\033[1;34m' ^-------^ SC2034 (warning): ANSI_BLUE appears unused. Verify use (or export if used externally). ```
```
$ git ls-files -z --cached --others --exclude-standard ':(exclude)*.rb' 'bin/*' '*/bin/*' '*.sh' | \
xargs -0 shellcheck --check-sourced --color=always
In bin/support/bash_functions.sh line 34:
return $ec
^-^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
return "$ec"
In bin/support/bash_functions.sh line 53:
return $skip_java_install
^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
return "$skip_java_install"
For more information:
https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
```
04afbbd to
8484138
Compare
dzuelke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's easier/safer to have the escape codes evaluated at time of assignment (using $'...' syntax), and then use a plain echo without -e, or, even simpler and without a while read loop, have sed do the "wrapping"
Co-authored-by: David Zuelke <[email protected]> Signed-off-by: Richard Schneeman <[email protected]>
Co-authored-by: David Zuelke <[email protected]> Signed-off-by: Richard Schneeman <[email protected]>
```
$ git ls-files -z --cached --others --exclude-standard ':(exclude)*.rb' 'bin/*' '*/bin/*' '*.sh' | \
xargs -0 shellcheck --check-sourced --color=always
In bin/support/bash_functions.sh line 19:
local line
^--^ SC2034 (warning): line appears unused. Verify use (or export if used externally).
```
|
I merged all your blocking style suggestions and added an output to the sed line. This is now ready for re-review. I'll start working on a PR to https://github.com/heroku/heroku-buildpack-python/blob/b4260ada2ea84dd54b318117ba94183ba5c41e03/lib/output.sh#L70-L87 to apply your style suggestions to the source of that code. |
I got approval from Colin on the suggested changes. If there's more, I'll prioritize them. I need to get this fix released to customers.
When:
heroku/rubyas a buildpack (NOT during the auto-buildpack detection)GemfileWhen they should see a detailed error output explaining why they couldn't deploy. This behavior was added in #1647 and this error was reported in #1647 (comment).
GUS-W-20256726