1
0
mirror of https://github.com/TheLocehiliosan/yadm synced 2026-03-02 03:49:29 +00:00

get rid of dependencies (pure bash)

This commit is contained in:
Martin Zuther
2019-12-29 15:53:01 +01:00
parent 45b218d5c1
commit 9c9a750009
2 changed files with 21 additions and 23 deletions

View File

@@ -83,10 +83,12 @@ if [ $ERROR_CODE -ne 0 ]; then
echo -e "\033[0;31m"
while IFS= read -r line; do
# try to beautify output (requires "grep" and "sed")
if command -v grep > /dev/null && command -v sed > /dev/null; then
echo "$line" | grep -iv "\sok$" | sed 's/^/ / ; s/: FAILED$// ; /^.*WARNING:.*did NOT match$/ d'
else
# beautify output and get rid of unnecessary lines
line="${line%%*: [Oo][Kk]}"
line="${line%%: [Ff][Aa][Ii][Ll][Ee][Dd]}"
line="${line##*WARNING:*did NOT match}"
if [ -n "$line" ]; then
echo "$line"
fi
done <<< "$YADM_CHECKSUM_OUTPUT"