We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Many recipes have shell scripts (e.g. build.sh, post-link.sh, pre-unlink.sh). Some of those scripts have portability issues, such as:
build.sh
post-link.sh
pre-unlink.sh
This makes those scripts fragile, or lead to unwanted effects.
For instance, if a user installs a package on a conda environment with spaces, like /path/with spaces a post installation script like:
/path/with spaces
#!/bin/sh DIR="/path/with spaces" # whatever work done here rm -rf $DIR
will remove "/path/with" and "spaces" instead of "/path/with spaces"
More dangerously could be a path with a trailing space:
#!/bin/sh #DIR="/path/with-a-trailing-space /" #rm -rf $DIR
Which I have commented out because you do not want to remove / by accident.
/
shellcheck is a tool that checks shell scripts and looks for potential and common errors. See more bad-code examples here: https://github.com/koalaman/shellcheck/blob/master/README.md#gallery-of-bad-code
It is widely available (as a debian package, installable through brew on osx and on conda-forge).
Linting bioconda scripts with shellcheck could prevent many of those issues.
shellcheck recipes/bioconductor-dapardata/*.sh
It would be great to try to have an integrated linter in bioconda to detect those issues and suggest corrections.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Problem
Many recipes have shell scripts (e.g.
build.sh
,post-link.sh
,pre-unlink.sh
). Some of those scripts have portability issues, such as:This makes those scripts fragile, or lead to unwanted effects.
For instance, if a user installs a package on a conda environment with spaces, like
/path/with spaces
a post installation script like:will remove "/path/with" and "spaces" instead of "/path/with spaces"
More dangerously could be a path with a trailing space:
Which I have commented out because you do not want to remove
/
by accident.Solution: shellcheck
shellcheck is a tool that checks shell scripts and looks for potential and common errors. See more bad-code examples here: https://github.com/koalaman/shellcheck/blob/master/README.md#gallery-of-bad-code
It is widely available (as a debian package, installable through brew on osx and on conda-forge).
Linting bioconda scripts with shellcheck could prevent many of those issues.
It would be great to try to have an integrated linter in bioconda to detect those issues and suggest corrections.
The text was updated successfully, but these errors were encountered: