replace echo with printf for edge cases
This commit is contained in:
parent
4e201c68be
commit
c9aadf4737
12
driver.sh
12
driver.sh
@ -2,21 +2,21 @@
|
||||
cd "$(dirname "$0")" || exit 1
|
||||
|
||||
ok() {
|
||||
echo "[OK] $3"
|
||||
printf '[OK] %s\n' "$3"
|
||||
}
|
||||
|
||||
warn() {
|
||||
echo "[WARN] $3"
|
||||
printf '[WARN] %s\n' "$3"
|
||||
}
|
||||
|
||||
run_module() {
|
||||
set -eu
|
||||
|
||||
. "$1"
|
||||
echo "$name"
|
||||
printf '%s\n' "$name"
|
||||
|
||||
if [ "$available" -ne 1 ]; then
|
||||
echo "not available"
|
||||
printf 'not available\n'
|
||||
return
|
||||
fi
|
||||
|
||||
@ -27,7 +27,7 @@ ls modules | while IFS= read -r module; do
|
||||
[ -f "modules/$module" ] || continue
|
||||
( run_module "modules/$module" )
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "Error running module: $module"
|
||||
printf 'Error running module: %s\n' "$module"
|
||||
fi
|
||||
echo
|
||||
printf '\n'
|
||||
done
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user