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,27 +1,28 @@
#!/usr/bin/env bash
[[ " help shell: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 | shell:help)
help_content_func () {
help_content_func() {
declare desc="return shell plugin help content"
cat<<help_content
cat <<help_content
shell, Spawn dokku shell
help_content
}
if [[ $1 = "shell:help" ]] ; then
echo -e 'Usage: dokku shell'
echo ''
echo 'Dokku shell is an interactive dokku prompt.'
echo ''
echo 'Note: See dokku enter:help for shell access to containers.'
echo ''
echo 'Additional commands:'
help_content_func | sort | column -c2 -t -s,
if [[ $1 == "shell:help" ]]; then
echo -e 'Usage: dokku shell'
echo ''
echo 'Dokku shell is an interactive dokku prompt.'
echo ''
echo 'Note: See dokku enter:help for shell access to containers.'
echo ''
echo 'Additional commands:'
help_content_func | sort | column -c2 -t -s,
else
help_content_func
help_content_func
fi
;;

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
shell_cmd() {
declare desc="dokku shell interpreter via command line"
@@ -9,8 +10,7 @@ shell_cmd() {
history -r || true
trim()
{
trim() {
sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g'
}
@@ -19,7 +19,9 @@ shell_cmd() {
while true; do
trap '' SIGINT
read -rep "dokku> " line || {
echo; true; break
echo
true
break
}
trap - SIGINT
@@ -36,7 +38,7 @@ shell_cmd() {
clear
;;
quit|exit)
quit | exit)
break
;;
@@ -44,6 +46,7 @@ shell_cmd() {
*)
# shellcheck disable=SC2086
dokku $line || true
;;
esac
done