diff --git a/scripts/cc.ps1 b/scripts/cc.ps1 new file mode 100644 index 0000000..35f8ac5 --- /dev/null +++ b/scripts/cc.ps1 @@ -0,0 +1,3 @@ +Write-Host -NoNewLine "Removing __pycache__/ recursively..." +Get-ChildItem -Include __pycache__ -Recurse -force | Remove-Item -Force -Recurse +Write-Host "OK" \ No newline at end of file diff --git a/scripts/cc.sh b/scripts/cc.sh new file mode 100644 index 0000000..185ac59 --- /dev/null +++ b/scripts/cc.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +function traverse() { + for file in "$1"/* + do + if [ ! -d "${file}" ] ; then + continue + else + if [[ "${file}" == *"pycache"* ]] ; then + rm -rf "${file}" + else + traverse "${file}" + fi + fi + done +} + +printf "Removing __pycache__/ recursively..." +traverse "." +printf "OK\n" \ No newline at end of file diff --git a/scripts/rc.sh b/scripts/rc.sh deleted file mode 100644 index 7124ca7..0000000 --- a/scripts/rc.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# Remove the Cpython created binaries from __pycache__ -# recursively from the root directory. Use with care, -# will invoke `rm -rf` and remove everything named *pycache*. - -function traverse() { - for file in "$1"/* - do - if [ ! -d "${file}" ]; then - continue - else - if [[ "${file}" == *"pycache"* ]]; then - rm -rf "${file}" - else - traverse "${file}" - fi - fi - done -} - -echo "Revoming all __pycache__ directories from $PWD" -traverse "."