]> code.delx.au - notipod/commitdiff
Don't sync to folders that don't exist
authorJames Bunton <jamesbunton@fastmail.fm>
Fri, 1 Jul 2011 13:37:39 +0000 (23:37 +1000)
committerJames Bunton <jamesbunton@fastmail.fm>
Fri, 1 Jul 2011 13:37:39 +0000 (23:37 +1000)
libnotipod.py

index 3e30e4d965d61f4e3e664b16a5b8c83d927a031e..7f1a6b0c31a15b46230d2e4d9baae62b41ff9626 100644 (file)
@@ -197,6 +197,8 @@ def sync(dry_run, source, dest, files_to_copy):
                filemap[sf.encoded_filename.lower()] = sf
        files_to_copy = set(filemap)
 
+       if not os.path.isdir(dest):
+               raise OSError("No such file or directory: '%s'" % dest)
        for dirpath, dirnames, filenames in os.walk(dest):
                full_dirpath = dirpath
                dirpath = strip_prefix(dirpath, dest)