diff --git a/gitback/__init__.py b/gitback/__init__.py index 517dc59..60ddc55 100644 --- a/gitback/__init__.py +++ b/gitback/__init__.py @@ -22,7 +22,7 @@ def backup()->None: if exists(name+'.zip') and args.zip: exit(f'You already have a {name} zip, please move it somewhere else until the process is done') if args.zip: backup = ZipFile(name+'.zip', 'w', 8) try: mkdir(name) - except: exit(f'You already have a {name} folder, please move it somewhere else until the process is done') + except FileExistsError: exit(f'You already have a {name} folder, please move it somewhere else until the process is done') chdir(name) username, git_command = args.username if args.username is not None else input("Your GitHub username: "), 'git clone ' if not args.full: git_command += '--depth 1 ' diff --git a/gitback/__main__.py b/gitback/__main__.py index 7f2a2b3..88fb7dc 100644 --- a/gitback/__main__.py +++ b/gitback/__main__.py @@ -2,4 +2,4 @@ from os import rmdir if __name__ == '__main__': try: backup() - except: rmdir("backup") \ No newline at end of file + except Exception: rmdir("backup") \ No newline at end of file