From 7cfcef713ed414b707a8b152e95cead610c6acd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Sun, 22 Mar 2020 05:12:09 +0100 Subject: [PATCH] add check if mountpoint is mount --- workdirfs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workdirfs.py b/workdirfs.py index 0401f4d..476baed 100755 --- a/workdirfs.py +++ b/workdirfs.py @@ -310,7 +310,7 @@ def main(args): mountpoint = Path(os.path.join(os.environ['HOME'], args.mountpoint)) if mountpoint.is_symlink(): mountpoint.unlink(); - if mountpoint.exists(): + if mountpoint.exists() and not mountpoint.is_mount(): if mountpoint.is_dir(): if os.listdir(mountpoint): mountpoint.rename(str(mountpoint) + "-" + datetime.now().strftime("%Y-%m-%d")