diff --git a/clear_pycache.sh b/clear_pycache.sh index 24293b8ec63c8742d03e9d006a15c3a401a5fee1..824efe72661a65cfff6480f98da7849dd723589c 100755 --- a/clear_pycache.sh +++ b/clear_pycache.sh @@ -19,23 +19,19 @@ text_reset="\033[0m" text_blue="\033[0;34m" -# Standardize current terminal path so script runs consistently, regardless of original terminal location. -cd "$(dirname "$0")"/.. - - function main () { # Get absolute path of current folder. current_folder="$(cd "$(dirname "${1}")" && pwd)/$(basename "${1}")" - echo -e "${text_blue}Starting Directory: \"${current_folder}\"${text_reset}" - echo "" - echo "Removing auto-generated files in PyCache directories:" + # echo -e "${text_blue}Starting Directory: \"${current_folder}\"${text_reset}" + # echo "" + echo -e "${text_blue}Removing auto-generated files in PyCache directories...${text_reset}" # Start with current directory, which should be project root. Pass in absolute path as start point. iterate_dir ${current_folder} - echo "" - echo -e "${text_blue}PyCache directories cleared. Terminating script.${text_reset}" + # echo "" + echo -e "${text_blue}PyCache directories cleared.${text_reset}" } @@ -55,7 +51,7 @@ function iterate_dir () { if [[ "${dir_name}" == "__pycache__" ]] then # Is PyCache directory. Check all files within. - echo " ${dir}" + # echo " ${dir}" for file in "${dir}/"* do # Check if value is actually a file. @@ -66,7 +62,7 @@ function iterate_dir () { if [[ "${file_extension}" == "pyc" ]] then # Is confirmed PyCache file. These are automatically generated so we can simply delete it. - rm ${file} + rm ${file} > /dev/null 2>&1 fi fi done