From 67143a2b1656b6984a3503275d4dc6cd2118928d Mon Sep 17 00:00:00 2001 From: Pablo Hinojosa Date: Wed, 12 Aug 2020 16:00:30 +0200 Subject: [PATCH] Add an exception if mount folder does not exist Related: https://github.com/dsoprea/GDriveFS/issues/212 --- gdrivefs/resources/scripts/gdfs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdrivefs/resources/scripts/gdfs b/gdrivefs/resources/scripts/gdfs index 75435e8..08d2b16 100755 --- a/gdrivefs/resources/scripts/gdfs +++ b/gdrivefs/resources/scripts/gdfs @@ -60,6 +60,10 @@ def _main(): _logger.debug("Mounting GD with creds at [%s]: %s", args.auth_storage_filepath, args.mountpoint) + + if not os.path.isdir(args.mountpoint): + _logger.exception("bad mount point %s: Directory not found", args.mountpoint) + raise Exception("bad mount point {}: Directory not found".format(args.mountpoint)) if args.fake is True: _logger.warning("'Fake' mount. Exiting successfully.")