tests: run mvdan/shfmt on test runs

While I do not agree with _every_ style change, this will force Dokku to have consistent formatting across all shell scripts, which is arguably a Good Thing™.

The command used to reprocess everything is:

```shell
shfmt -l -bn -ci -i 2 -w .
```
This commit is contained in:
Jose Diaz-Gonzalez
2019-01-07 01:04:17 -05:00
parent fb7c73a7e3
commit 86795ddacc
283 changed files with 1536 additions and 1018 deletions

View File

@@ -1,25 +1,26 @@
#!/usr/bin/env bash
[[ " help enter:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
case "$1" in
help | enter:help)
help_content_func () {
help_content_func() {
declare desc="return enter plugin help content"
cat<<help_content
cat <<help_content
enter <app> [<container-type> || --container-id <container-id>], Connect to a specific app container
help_content
}
if [[ $1 = "enter:help" ]] ; then
echo -e 'Usage: dokku enter <app>'
echo ''
echo 'Allows you to access a bash prompt inside the container of the app.'
echo ''
echo 'Additional commands:'
help_content_func | sort | column -c2 -t -s,
if [[ $1 == "enter:help" ]]; then
echo -e 'Usage: dokku enter <app>'
echo ''
echo 'Allows you to access a bash prompt inside the container of the app.'
echo ''
echo 'Additional commands:'
help_content_func | sort | column -c2 -t -s,
else
help_content_func
help_content_func
fi
;;

View File

@@ -1,12 +1,16 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
enter_default_cmd() {
declare desc="enters running app container of specified proc type"
local cmd="enter"
local APP="$2"; local CONTAINER_TYPE="$3"; local IMAGE_TAG=$(get_running_image_tag "$APP"); local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
local APP="$2"
local CONTAINER_TYPE="$3"
local IMAGE_TAG=$(get_running_image_tag "$APP")
local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
verify_app_name "$APP"
local AVAILABLE_CONTAINER_TYPES=($(get_app_running_container_types "$APP"))
@@ -20,7 +24,7 @@ enter_default_cmd() {
fi
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
dokku_log_warn "No container id specified."
dokku_log_fail "Available ids for app ($APP): ${DOKKU_APP_CIDS[*]}"
@@ -32,7 +36,7 @@ enter_default_cmd() {
local ID=$(printf -- '%s\n' "${DOKKU_APP_CIDS[@]}" | grep -e "^$4")
shift 4
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]}
if [[ ! -n $ID ]]; then
dokku_log_warn "No containers found for type '$CONTAINER_TYPE'"