sequencer - addconf: allow empty source and fix printf missing newline

This commit is contained in:
2022-08-12 18:05:33 +02:00
parent b97f880b2a
commit e289f37be2

View File

@@ -866,7 +866,7 @@ addConf() {
esac esac
done done
local source="${1:?}" local source="${1:-}"
local dest="${2:?}" local dest="${2:?}"
if [ "${transferCmd}" == "cat" ] && [ ! -f "${source}" ] ; then if [ "${transferCmd}" == "cat" ] && [ ! -f "${source}" ] ; then
@@ -905,7 +905,7 @@ addConf() {
else else
"${transferCmd}" "${source}" >> "${dest}" "${transferCmd}" "${source}" >> "${dest}"
fi fi
sqr::printf 'ok\n [i] %s' "Existing config saved to ${addConfBackup}" sqr::printf 'ok\n [i] %s\n' "Existing config saved to ${addConfBackup}"
return 0 return 0
else else
sqr::echo "nok" sqr::echo "nok"