From 22f4b330876ec1d46a7beb484d9100f369dd9571 Mon Sep 17 00:00:00 2001 From: reloxx13 Date: Fri, 22 Oct 2021 02:30:17 +0200 Subject: [PATCH] Add clean_pyc.bat (#1527) * Create clean_pyc.bat Add pyc cleaner script for windows to clear all pyc cache files. https://github.com/Tautulli/Tautulli/issues/1523#issuecomment-944938745 * Update clean_pyc.bat fix comment * Remove __pycache__ folders in clean_pyc scripts Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> --- contrib/clean_pyc.bat | 11 +++++++++++ contrib/clean_pyc.sh | 6 ++++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 contrib/clean_pyc.bat mode change 100755 => 100644 contrib/clean_pyc.sh diff --git a/contrib/clean_pyc.bat b/contrib/clean_pyc.bat new file mode 100644 index 00000000..e4436dea --- /dev/null +++ b/contrib/clean_pyc.bat @@ -0,0 +1,11 @@ +@echo off +:: Display information +echo This script will remove *.pyc files. These files are generated by Python, but they can cause conflicts after an upgrade. It's safe to remove them, because they will be regenerated. +echo Press enter to continue, or CTRL + C to quit. +pause + +cd ..\ +:: Remove *.pyc files +del /S *.pyc +:: Remove __pycache__ folders +for /d /r . %%d in (__pycache__) do @if exist "%%d" rd /s /q "%%d" \ No newline at end of file diff --git a/contrib/clean_pyc.sh b/contrib/clean_pyc.sh old mode 100755 new mode 100644 index 9283fb59..ea555159 --- a/contrib/clean_pyc.sh +++ b/contrib/clean_pyc.sh @@ -5,5 +5,7 @@ echo "This script will remove *.pyc files. These files are generated by Python, echo "Press enter to continue, or CTRL + C to quit." read -# Remove the *.pyc -find "`dirname $0`/.." -type f -name "*.pyc" -exec rm -rf {} \; \ No newline at end of file +# Remove *.pyc files +find "`dirname $0`/.." -type f -name "*.pyc" -exec rm -rf {} \; +# Remove __pycache__ folders +find "`dirname $0`/.." -type d -name "__pycache__" -exec rm -rf {} \; \ No newline at end of file