-
Notifications
You must be signed in to change notification settings - Fork 573
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
Allow packaging and distribution projects to easily configure data and binary directories #2
Comments
Closed
1 task
Implemented in master |
JonTheNiceGuy
added a commit
to JonTheNiceGuy/adr-tools
that referenced
this issue
Jan 18, 2021
* Added a default value for adr_bin_dir * Added relevant quotes and double quotes * Moved compgen commands into a while/read line/do/done loop, and put match detection in there too. ``` In _adr_autocomplete line 2: eval "$($(dirname $0)/adr-config)" ^-----------^ SC2046: Quote this to prevent word splitting. ^-- SC2086: Double quote to prevent globbing and word splitting. Did you mean: eval "$($(dirname "$0")/adr-config)" In _adr_autocomplete line 4: cmds=("$@") ^--^ SC2034: cmds appears unused. Verify use (or export if used externally). In _adr_autocomplete line 5: available_commands=$( $adr_bin_dir/_adr_commands | sort ) ^----------^ SC2154: adr_bin_dir is referenced but not assigned. ^----------^ SC2086: Double quote to prevent globbing and word splitting. Did you mean: available_commands=$( "$adr_bin_dir"/_adr_commands | sort ) In _adr_autocomplete line 9: suggestions=($( compgen -W "${available_commands}" -- "$2" )) ^-- SC2207: Prefer mapfile or read -a to split command output (or quote to avoid splitting). In _adr_autocomplete line 10: if [ "$suggestions" != "$2" ] ^----------^ SC2128: Expanding an array without an index only gives the first element. In _adr_autocomplete line 17: subcmds_files=( $(compgen -G "$adr_bin_dir/_adr_$2_"'*' | sort ) ) ^-- SC2207: Prefer mapfile or read -a to split command output (or quote to avoid splitting). In _adr_autocomplete line 22: basename $f | cut -c $(( ${npryce#2} + 7 ))- ^-- SC2086: Double quote to prevent globbing and word splitting. Did you mean: basename "$f" | cut -c $(( ${npryce#2} + 7 ))- In _adr_autocomplete line 24: suggestions=($( compgen -W "${subcmds}" -- "$3" )) ^-- SC2207: Prefer mapfile or read -a to split command output (or quote to avoid splitting). In _adr_autocomplete line 25: if [ "$suggestions" != "$3" ] ^----------^ SC2128: Expanding an array without an index only gives the first element. For more information: https://www.shellcheck.net/wiki/SC2034 -- cmds appears unused. Verify use (... https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt... https://www.shellcheck.net/wiki/SC2128 -- Expanding an array without an ind... ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See issue #1 for an example why this is needed.
Current thoughts:
Have a
config.sh
file that is sourced at the top of every script, and defines location of files.E.g.:
And config.sh would define shell variables (not environment variables). The default would be:
Packaging scripts could replace the entire file. E.g.
Comments from packaging experts welcome.
The text was updated successfully, but these errors were encountered: