refinement

This commit is contained in:
dtb 2022-09-10 00:04:17 -04:00
parent 2cc10d34ae
commit a765639c85
1 changed files with 11 additions and 5 deletions

View File

@ -1,14 +1,20 @@
#!/bin/sh
set -e
set -ex
argv0="$0"
# cats out the configuration or {'\n', EOF} if it can't be found
stream_config(){
cat "$HOME"/.xdg-sanity.conf 2>/dev/null \
|| cat "$HOME"/.config/xdg-sanity.conf 2>/dev/null \
|| cat /etc/xdg-sanity/xdg-sanity.conf 2>/dev/null \
|| echo # empty line
for file in \
"$HOME"/.config/xdg-sanity.conf \
"$HOME"/.xdg-sanity.conf \
/etc/xdg-sanity/xdg-sanity.conf \
/dev/null
do
cat "$file" 2>/dev/null \
&& break \
|| true
done
}
# check if usage is valid