diff --git a/CHANGELOG.md b/CHANGELOG.md index f1bf152..d12419e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ``CHANGELOG.md`` file with (Keep a Changelog)[https://keepachangelog.com/en/1.0.0/] format. +## [1.1.7] - 2021-03-13 +### Fixes +- Fixed [#28](https://github.com/Prayag2/konsave/issues/28) + +## Changes +- The program will now quit on any error + + ## [1.1.6] - 2021-03-11 ### Changes - Changed code style to [PEP8](https://www.python.org/dev/peps/pep-0008/) diff --git a/konsave/__pycache__/funcs.cpython-39.pyc b/konsave/__pycache__/funcs.cpython-39.pyc index d991af0..c7de2fc 100644 Binary files a/konsave/__pycache__/funcs.cpython-39.pyc and b/konsave/__pycache__/funcs.cpython-39.pyc differ diff --git a/konsave/funcs.py b/konsave/funcs.py index 3ce63be..d2e577d 100644 --- a/konsave/funcs.py +++ b/konsave/funcs.py @@ -5,6 +5,7 @@ ## IMPORT ## import os import shutil +import sys import configparser from random import shuffle from zipfile import is_zipfile, ZipFile @@ -43,6 +44,7 @@ def inner_func(*args, **kwargs): function = func(*args, **kwargs) except Exception as error: print(f"Konsave: {error}\nTry 'konsave -h' for more info!") + sys.exit(0) else: return function @@ -136,26 +138,24 @@ def copy(source, dest): source: the source destination dest: the destination to copy the file/folder to """ - assert isinstance(source, str) and isinstance(dest, str), "Invalid path" + assert type(source) == str and type(dest) == str, "Invalid path" assert source != dest, "Source and destination can't be same" assert os.path.exists(source), "Source path doesn't exist" if not os.path.exists(dest): os.mkdir(dest) - if os.path.isdir(source): - for item in os.listdir(source): - source_path = os.path.join(source, item) - dest_path = os.path.join(dest, item) + for item in os.listdir(source): + source_path = os.path.join(source, item) + dest_path = os.path.join(dest, item) - if os.path.isdir(source_path): - copy(source_path, dest_path) - else: - if os.path.exists(dest_path): - os.remove(dest_path) + if os.path.isdir(source_path): + copy(source_path, dest_path) + else: + if os.path.exists(dest_path): + os.remove(dest_path) + if os.path.exists(source_path): shutil.copy(source_path, dest) - else: - shutil.copy(source, dest) # LIST PROFILES diff --git a/konsave/vars.py b/konsave/vars.py index e575c69..7a46ccb 100644 --- a/konsave/vars.py +++ b/konsave/vars.py @@ -22,4 +22,4 @@ length_of_lop = len(list_of_profiles) # Current Version -VERSION = "1.1.6" +VERSION = "1.1.7"