Skip to content
Snippets Groups Projects
Commit 75bad485 authored by Christian De Schryver's avatar Christian De Schryver
Browse files

added cleanup script + instructions

parent 72faa3b3
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,8 @@ This LaTeX report template can be used easily with any TeX distribution by runni
*Important*: This repository depends on a Git submodule that holds the style definition. Therefore, a regular ```git clone``` command is not sufficient to obain the submodule as well! Please use ```git clone --recursive``` instead.
You can use the ```cleanup.py``` script in order to remove unncesseary files that may prevent the template from compiling e.g. on Overleaf.
## Build
Use your favorite LaTeX IDE / editor or optionally open a terminal and use make.
......
import os
import shutil
def delete_files_and_directories(curDir, delPaths):
for path in delPaths:
full_path = os.path.join(current_directory, path)
if not os.path.exists(full_path):
print(f"Warning: '{path}' does not exist in the current directory.")
continue
if os.path.isfile(full_path):
print(f"Deleting file: {full_path}")
os.remove(full_path)
elif os.path.isdir(full_path):
print(f"Deleting directory: {full_path}")
shutil.rmtree(full_path, ignore_errors=True)
else:
print(f"Warning: Unable to delete '{path}' as it is neither a file nor a directory.")
# EntryPunkt
if __name__ == "__main__":
# Read the file containing file and directory paths to delete
file_paths_file = os.path.join(os.getcwd(), "deletefiles.txt").replace("\\", "/")
# Current Directory wird geholt.
current_directory = os.getcwd()
with open(file_paths_file, "r") as f:
paths = f.read().splitlines()
try:
delete_files_and_directories(current_directory, paths)
except FileNotFoundError:
print(f"Error: '{file_paths_file}' not found.")
except Exception as e:
print(f"Error: An error occurred while processing the file: {e}")
\ No newline at end of file
style-eit-latex\.gitattributes
style-eit-latex\RedHatFont\.github
style-eit-latex\.gitignore
style-eit-latex\RedHatFont\mastering
style-eit-latex\RedHatFont\source
style-eit-latex\RedHatFont\metainfo
style-eit-latex\RedHatFont\webfonts
style-eit-latex\RedHatFont\.gitignore
style-eit-latex\RedHatFont\AUTHORS.txt
style-eit-latex\RedHatFont\CHANGELOG.md
.gitattributes
.gitignore
.gitmodules
style-eit-latex\.gitmodules
style-eit-latex\LICENSE.txt
style-eit-latex\README.md
LICENSE.txt
README.md
style-eit-latex\RedHatFont\build-scripts
style-eit-latex\RedHatFont\build-all.sh
style-eit-latex\RedHatFont\LICENSE
style-eit-latex\RedHatFont\package-lock.json
style-eit-latex\RedHatFont\package.json
style-eit-latex\RedHatFont\README.md
style-eit-latex\RedHatFont\requirements.txt
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment