Skip to content

Commit

Permalink
KPMP-5665: don't exit, uncomment move code
Browse files Browse the repository at this point in the history
  • Loading branch information
zwright committed Dec 17, 2024
1 parent 62dd74b commit 0cf3e44
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions scripts/packageChecker/packageChecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ def find_empty_packages(self, move_derived=False):
clean_file_name = file_name.replace("[", "").replace("]", "").replace(",", "").replace("'", "")
if clean_file_name != 'derived' and 'svs' not in clean_file_name:
self.move_file_to_derived(directory, clean_file_name)
# os._exit(0)

except:
missing_package_list.append(package_id)
Expand Down Expand Up @@ -142,16 +141,16 @@ def move_file_to_derived(self, package_directory, file_name):
file_path = package_directory + "/" + file_name
if os.path.isfile(file_path):
print(f"Moving file '{file_path}' to '{derived_dir}'.")
# if not os.path.exists(derived_dir):
# os.makedirs(derived_dir)
#
# try:
# shutil.move(file_path, derived_dir)
# print(f"File '{file_path}' moved to '{derived_dir}' successfully.")
# except FileNotFoundError:
# print(f"Error: File '{source_file}' not found.")
# except Exception as e:
# print(f"An error occurred: {e}")
if not os.path.exists(derived_dir):
os.makedirs(derived_dir)

try:
shutil.move(file_path, derived_dir)
print(f"File '{file_path}' moved to '{derived_dir}' successfully.")
except FileNotFoundError:
print(f"Error: File '{source_file}' not found.")
except Exception as e:
print(f"An error occurred: {e}")
else:
print(f"'{file_path}' is not a file. Skipping.")

Expand Down

0 comments on commit 0cf3e44

Please sign in to comment.