refactor(script): Abort early and with clear msg when no datasets snapshottable (#1)

This commit is contained in:
hygienic-books 2023-12-26 05:58:07 +01:00
parent c23567e2b1
commit ff963aa844

View File

@ -375,8 +375,18 @@ function main () {
local local_snappable_datasets
get_local_snappable_datasets
trim_globally_snappable_datasets
if [[ "${#snappable_datasets[@]}" -eq '0' ]]; then
pprint 'info' 'ZFS snapshot skipped, no local (= currently mounted) dataset has'
pprint 'info' 'property '"'"''"${zfs_prop}"''"'"' set to '"'"'true'"'"'. At the same'
pprint 'info' 'time option '"'"'snap_only_local_datasets'"'"' equals '"'"'true'"'"' so'
pprint 'info' 'we must only snapshot local datasets. Nothing to do here while'
pprint 'info' 'none of them have '"'"''"${zfs_prop}"''"'"' set to '"'"'true'"'"'.' '0'
fi
else
snappable_datasets=("${globally_snappable_datasets}")
if [[ "${#snappable_datasets[@]}" -eq '0' ]]; then
pprint 'info' 'ZFS snapshot skipped, no dataset has property '"'"''"${zfs_prop}"''"'"' set to '"'"'true'"'"'.' '0'
fi
fi
local unabridged_pkg_list_oneline