summaryrefslogtreecommitdiff
path: root/lbup/targets.py
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-10-17 23:04:33 +0200
committerAnton Khirnov <anton@khirnov.net>2020-10-18 09:19:25 +0200
commitb9bdcd3bcf679f011966565c352181a748a2847e (patch)
tree032c0de647b921be4b490cfb5b726328f152f360 /lbup/targets.py
parent531f4a5efdec9e9b3a8da80b5f0e757bc7d06be1 (diff)
targets: check that at least one dir to backup is given
It makes no sense to backup zero dirs and some things might break in potentially dangerous ways if attempted.
Diffstat (limited to 'lbup/targets.py')
-rw-r--r--lbup/targets.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lbup/targets.py b/lbup/targets.py
index ddd0257..217c253 100644
--- a/lbup/targets.py
+++ b/lbup/targets.py
@@ -44,6 +44,9 @@ class Target(ABC):
if excludes is None:
excludes = []
+ if len(dirs) < 1:
+ raise ValueError('One or more dirs to backup required')
+
self.name = name
self.dirs = dirs
self.excludes = excludes