#!/bin/sh
#
# @author René Schwaiger <sanssecours@me.com>
# @brief Reformats Shell source code
# @date 07.09.2018
# @tags reformat

SCRIPTS_DIR=$(dirname "$0")
. "${SCRIPTS_DIR}/include-common"

cd "$SOURCE"

if ! which shfmt > /dev/null; then
	printf 2>&1 'Please install `shfmt`\n'
	exit 1
fi

for file in $(shfmt -f scripts tests/shell); do
	shfmt -s -sr -w "$file"
done
