Merge pull request #3435 from dokku/lint-updates

Lint updates
This commit is contained in:
Jose Diaz-Gonzalez
2019-02-02 14:22:12 -05:00
committed by GitHub
42 changed files with 97 additions and 97 deletions

View File

@@ -24,7 +24,7 @@ log-fail() {
# shellcheck disable=SC2034 # shellcheck disable=SC2034
declare desc="Log fail formatter" declare desc="Log fail formatter"
log-error "$*" log-error "$*"
exit -1 exit 1
} }
fn-build-dokku() { fn-build-dokku() {

View File

@@ -24,7 +24,7 @@ log-fail() {
# shellcheck disable=SC2034 # shellcheck disable=SC2034
declare desc="Log fail formatter" declare desc="Log fail formatter"
log-error "$*" log-error "$*"
exit -1 exit 1
} }
fn-build-dokku() { fn-build-dokku() {

View File

@@ -24,7 +24,7 @@ log-fail() {
# shellcheck disable=SC2034 # shellcheck disable=SC2034
declare desc="Log fail formatter" declare desc="Log fail formatter"
log-error "$*" log-error "$*"
exit -1 exit 1
} }
fn-build-dokku() { fn-build-dokku() {

View File

@@ -22,7 +22,7 @@ log-fail() {
# shellcheck disable=SC2034 # shellcheck disable=SC2034
declare desc="Log fail formatter" declare desc="Log fail formatter"
log-error "$*" log-error "$*"
exit -1 exit 1
} }
fn-github-download-release() { fn-github-download-release() {

6
deb.mk
View File

@@ -95,9 +95,9 @@ deb-herokuish:
@echo "#!/usr/bin/env bash" >> /tmp/tmp/post-install @echo "#!/usr/bin/env bash" >> /tmp/tmp/post-install
@echo "sleep 5" >> /tmp/tmp/post-install @echo "sleep 5" >> /tmp/tmp/post-install
@echo "echo 'Importing herokuish into docker (around 5 minutes)'" >> /tmp/tmp/post-install @echo "echo 'Importing herokuish into docker (around 5 minutes)'" >> /tmp/tmp/post-install
@echo 'if [[ ! -z $${http_proxy+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install @echo 'if [[ -n $${http_proxy+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install
@echo 'if [[ ! -z $${https_proxy+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install @echo 'if [[ -n $${https_proxy+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install
@echo 'if [[ ! -z $${BUILDARGS+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install @echo 'if [[ -n $${BUILDARGS+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install
@echo "sudo docker pull gliderlabs/herokuish:v${HEROKUISH_VERSION} && sudo docker tag gliderlabs/herokuish:v${HEROKUISH_VERSION} gliderlabs/herokuish:latest" >> /tmp/tmp/post-install @echo "sudo docker pull gliderlabs/herokuish:v${HEROKUISH_VERSION} && sudo docker tag gliderlabs/herokuish:v${HEROKUISH_VERSION} gliderlabs/herokuish:latest" >> /tmp/tmp/post-install
@echo "-> Creating $(HEROKUISH_PACKAGE_NAME)" @echo "-> Creating $(HEROKUISH_PACKAGE_NAME)"

View File

@@ -45,7 +45,7 @@ hello_main_cmd() {
# Use the following lines to reorder args into "$cmd $DOKKU_APP_NAME $@"" # Use the following lines to reorder args into "$cmd $DOKKU_APP_NAME $@""
local argv=("$@") local argv=("$@")
[[ ${argv[0]} == "$cmd" ]] && shift 1 [[ ${argv[0]} == "$cmd" ]] && shift 1
[[ ! -z $DOKKU_APP_NAME ]] && set -- $DOKKU_APP_NAME $@ [[ -n $DOKKU_APP_NAME ]] && set -- $DOKKU_APP_NAME $@
set -- $cmd $@ set -- $cmd $@
## ##
@@ -73,7 +73,7 @@ hello_world_cmd() {
# Use the following lines to reorder args into "$cmd $DOKKU_APP_NAME $@"" # Use the following lines to reorder args into "$cmd $DOKKU_APP_NAME $@""
local argv=("$@") local argv=("$@")
[[ ${argv[0]} == "$cmd" ]] && shift 1 [[ ${argv[0]} == "$cmd" ]] && shift 1
[[ ! -z $DOKKU_APP_NAME ]] && set -- $DOKKU_APP_NAME $@ [[ -n $DOKKU_APP_NAME ]] && set -- $DOKKU_APP_NAME $@
set -- $cmd $@ set -- $cmd $@
## ##

2
dokku
View File

@@ -136,7 +136,7 @@ execute_dokku_cmd() {
if [[ "$(readlink -f "$PLUGIN_ENABLED_PATH/${PLUGIN_NAME%%:*}")" == *core-plugins* ]]; then if [[ "$(readlink -f "$PLUGIN_ENABLED_PATH/${PLUGIN_NAME%%:*}")" == *core-plugins* ]]; then
[[ ${argv[0]} == "$PLUGIN_CMD" ]] && shift 1 [[ ${argv[0]} == "$PLUGIN_CMD" ]] && shift 1
if [[ ! -z $DOKKU_APP_NAME ]]; then if [[ -n $DOKKU_APP_NAME ]]; then
if [[ "$PLUGIN_CMD" == config* ]] && [[ ${argv[1]} == "--no-restart" ]]; then if [[ "$PLUGIN_CMD" == config* ]] && [[ ${argv[1]} == "--no-restart" ]]; then
shift 1 shift 1
set -- "--no-restart" "$DOKKU_APP_NAME" "$@" set -- "--no-restart" "$DOKKU_APP_NAME" "$@"

View File

@@ -168,7 +168,7 @@ dokku_container_log_verbose_quiet() {
is_valid_app_name() { is_valid_app_name() {
declare desc="verify app name format" declare desc="verify app name format"
local APP="$1" local APP="$1"
[[ ! -n "$APP" ]] && dokku_log_fail "APP must not be null" [[ -z "$APP" ]] && dokku_log_fail "APP must not be null"
if [[ "$APP" =~ ^[a-z].* ]] || [[ "$APP" =~ ^[0-9].* ]]; then if [[ "$APP" =~ ^[a-z].* ]] || [[ "$APP" =~ ^[0-9].* ]]; then
if [[ ! $APP =~ [A-Z] ]] && [[ ! $APP =~ [:] ]]; then if [[ ! $APP =~ [A-Z] ]] && [[ ! $APP =~ [:] ]]; then
return 0 return 0

View File

@@ -32,7 +32,7 @@ docker_args() {
local line local line
read -r line || local DONE=true read -r line || local DONE=true
[[ ! -n "$line" ]] && continue [[ -z "$line" ]] && continue
# shellcheck disable=SC1001 # shellcheck disable=SC1001
case "$line" in case "$line" in

View File

@@ -248,7 +248,7 @@ get_default_vhosts() {
if ! ([[ "$VHOST" =~ $RE_IPV4 ]] || [[ "$VHOST" =~ $RE_IPV6 ]]); then if ! ([[ "$VHOST" =~ $RE_IPV4 ]] || [[ "$VHOST" =~ $RE_IPV6 ]]); then
local SUBDOMAIN=${APP/%\.${VHOST}/} local SUBDOMAIN=${APP/%\.${VHOST}/}
local hostname=$(: | plugn trigger nginx-hostname "$APP" "$SUBDOMAIN" "$VHOST") local hostname=$(: | plugn trigger nginx-hostname "$APP" "$SUBDOMAIN" "$VHOST")
if [[ ! -n $hostname ]]; then if [[ -z $hostname ]]; then
if [[ "$APP" == *.* ]] && [[ "$SUBDOMAIN" == "$APP" ]]; then if [[ "$APP" == *.* ]] && [[ "$SUBDOMAIN" == "$APP" ]]; then
local hostname="${APP/\//-}" local hostname="${APP/\//-}"
else else

View File

@@ -25,7 +25,7 @@ enter_default_cmd() {
if [[ "$3" == "--container-id" ]]; then if [[ "$3" == "--container-id" ]]; then
local DOKKU_APP_CIDS=($(get_app_container_ids "$APP")) local DOKKU_APP_CIDS=($(get_app_container_ids "$APP"))
if [[ ! -n "$4" ]]; then if [[ -z "$4" ]]; then
dokku_log_warn "No container id specified." dokku_log_warn "No container id specified."
dokku_log_fail "Available ids for app ($APP): ${DOKKU_APP_CIDS[*]}" dokku_log_fail "Available ids for app ($APP): ${DOKKU_APP_CIDS[*]}"
fi fi
@@ -38,7 +38,7 @@ enter_default_cmd() {
else else
local DOKKU_APP_CIDS=($(get_app_container_ids "$APP" "$CONTAINER_TYPE")) local DOKKU_APP_CIDS=($(get_app_container_ids "$APP" "$CONTAINER_TYPE"))
local ID=${DOKKU_APP_CIDS[0]} local ID=${DOKKU_APP_CIDS[0]}
if [[ ! -n $ID ]]; then if [[ -z $ID ]]; then
dokku_log_warn "No containers found for type '$CONTAINER_TYPE'" dokku_log_warn "No containers found for type '$CONTAINER_TYPE'"
dokku_log_fail "Available types for app ($APP): ${AVAILABLE_CONTAINER_TYPES[*]}" dokku_log_fail "Available types for app ($APP): ${AVAILABLE_CONTAINER_TYPES[*]}"
fi fi

View File

@@ -46,7 +46,7 @@ scheduler-docker-local-scheduler-run() {
PROC_CMD=$(get_cmd_from_procfile "$APP" "$POTENTIAL_PROCFILE_KEY" || echo '') PROC_CMD=$(get_cmd_from_procfile "$APP" "$POTENTIAL_PROCFILE_KEY" || echo '')
remove_procfile "$APP" remove_procfile "$APP"
if [ ! -z "$PROC_CMD" ]; then if [[ -n "$PROC_CMD" ]]; then
dokku_log_info1 "Found '$POTENTIAL_PROCFILE_KEY' in Procfile, running that command" dokku_log_info1 "Found '$POTENTIAL_PROCFILE_KEY' in Procfile, running that command"
set -- "$PROC_CMD" "${@:2}" set -- "$PROC_CMD" "${@:2}"
fi fi

6
rpm.mk
View File

@@ -29,9 +29,9 @@ rpm-herokuish:
@echo 'systemctl start docker' >> /tmp/tmp/post-install @echo 'systemctl start docker' >> /tmp/tmp/post-install
@echo "sleep 5" >> /tmp/tmp/post-install @echo "sleep 5" >> /tmp/tmp/post-install
@echo "echo 'Importing herokuish into docker (around 5 minutes)'" >> /tmp/tmp/post-install @echo "echo 'Importing herokuish into docker (around 5 minutes)'" >> /tmp/tmp/post-install
@echo 'if [[ ! -z $${http_proxy+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install @echo 'if [[ -n $${http_proxy+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install
@echo 'if [[ ! -z $${https_proxy+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install @echo 'if [[ -n $${https_proxy+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install
@echo 'if [[ ! -z $${BUILDARGS+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install @echo 'if [[ -n $${BUILDARGS+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install
@echo "sudo docker pull gliderlabs/herokuish:v${HEROKUISH_VERSION} && sudo docker tag gliderlabs/herokuish:v${HEROKUISH_VERSION} gliderlabs/herokuish:latest" >> /tmp/tmp/post-install @echo "sudo docker pull gliderlabs/herokuish:v${HEROKUISH_VERSION} && sudo docker tag gliderlabs/herokuish:v${HEROKUISH_VERSION} gliderlabs/herokuish:latest" >> /tmp/tmp/post-install
@echo "-> Creating $(HEROKUISH_RPM_PACKAGE_NAME)" @echo "-> Creating $(HEROKUISH_RPM_PACKAGE_NAME)"