Resolve SC2001: 'See if you can use ${var//search/replace} instead'

https://github.com/koalaman/shellcheck/wiki/SC2001
This commit is contained in:
Dan Callahan committed 2015-11-04 20:43:41 -06:00
1 parent e1e7fbcc52
commit ff07842dc5
2 files changed
+2 -3

No files matched your search

+1 -1
View File
@@ -145,7 +145,7 @@ nginx_build_config() {
if [[ -z "$DOKKU_APP_LISTEN_PORT" ]] && [[ -z "$DOKKU_APP_LISTEN_IP" ]]; then if [[ -z "$DOKKU_APP_LISTEN_PORT" ]] && [[ -z "$DOKKU_APP_LISTEN_IP" ]]; then
shopt -s nullglob shopt -s nullglob
for DOKKU_APP_IP_FILE in $DOKKU_ROOT/$APP/IP.web.*; do for DOKKU_APP_IP_FILE in $DOKKU_ROOT/$APP/IP.web.*; do
DOKKU_APP_PORT_FILE=$(echo $DOKKU_APP_IP_FILE | sed -e "s:IP:PORT:g") DOKKU_APP_PORT_FILE="${DOKKU_APP_IP_FILE//IP/PORT}"
DOKKU_APP_LISTENER_IP=$(< $DOKKU_APP_IP_FILE) DOKKU_APP_LISTENER_IP=$(< $DOKKU_APP_IP_FILE)
DOKKU_APP_LISTENER_PORT=$(< $DOKKU_APP_PORT_FILE) DOKKU_APP_LISTENER_PORT=$(< $DOKKU_APP_PORT_FILE)
+1 -2
View File
@@ -61,10 +61,9 @@ lint:
# these are disabled due to their expansive existence in the codebase. we should clean it up though # these are disabled due to their expansive existence in the codebase. we should clean it up though
# SC2034: VAR appears unused - https://github.com/koalaman/shellcheck/wiki/SC2034 # SC2034: VAR appears unused - https://github.com/koalaman/shellcheck/wiki/SC2034
# SC2086: Double quote to prevent globbing and word splitting - https://github.com/koalaman/shellcheck/wiki/SC2086 # SC2086: Double quote to prevent globbing and word splitting - https://github.com/koalaman/shellcheck/wiki/SC2086
# SC2001: See if you can use ${variable//search/replace} instead. - https://github.com/koalaman/shellcheck/wiki/SC2001
@echo linting... @echo linting...
@$(QUIET) shellcheck ./contrib/dokku_client.sh @$(QUIET) shellcheck ./contrib/dokku_client.sh
@$(QUIET) find . -not -path '*/\.*' | xargs file | egrep "shell|bash" | egrep -v "directory|toml" | awk '{ print $$1 }' | sed 's/://g' | grep -v dokku_client.sh | xargs shellcheck -e SC2034,SC2086,SC2001 @$(QUIET) find . -not -path '*/\.*' | xargs file | egrep "shell|bash" | egrep -v "directory|toml" | awk '{ print $$1 }' | sed 's/://g' | grep -v dokku_client.sh | xargs shellcheck -e SC2034,SC2086
unit-tests: unit-tests:
@echo running unit tests... @echo running unit tests...