Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Fixes exit to 0 while no problem
Browse files Browse the repository at this point in the history
  • Loading branch information
CoolCoderCarl committed Jun 15, 2022
1 parent 732528a commit c506043
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions butler.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def get_files_extension(path_to_dir: str, special_ext="") -> Set:
list_dir = os.listdir(path_to_dir)

if len(list_dir) == 0:
exit(1)
exit(0)

files = [file for file in list_dir if os.path.isfile(path_to_dir + file)]
result = []
Expand Down Expand Up @@ -180,7 +180,7 @@ def get_files_to_combine(path_to_dir: str, special_files_extensions: str) -> Set
list_dir = os.listdir(path_to_dir)

if len(list_dir) == 0:
exit(1)
exit(0)

files = [file for file in list_dir if os.path.isfile(path_to_dir + file)]

Expand Down Expand Up @@ -235,7 +235,7 @@ def clean_the_dir(path_to_clean: str):
else:
if len(os.listdir(path_to_clean)) == 0:
delete_empty_dir(namespace.force, namespace.source)
exit(1)
exit(0)
else:
for filename in os.listdir(path_to_clean):
path = os.path.join(path_to_clean, filename)
Expand Down Expand Up @@ -284,7 +284,7 @@ def create_archive(dir_to_archive: str):
exit(1)
else:
if len(os.listdir(dir_to_archive)) == 0:
exit(1)
exit(0)
else:
with ZipFile(str(date_time) + ".zip", "w") as zip_obj:
for folder_name, sub_folders, filenames in os.walk(dir_to_archive):
Expand Down

0 comments on commit c506043

Please sign in to comment.