Created
December 6, 2023 12:53
-
-
Save Pixailz/3fcbd8d4a227e0ff73c5129f3481e1a2 to your computer and use it in GitHub Desktop.
clean for release
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ue | |
# Author: Pixailz | |
PATTERN=( | |
"\.git*" | |
"\.vscode" | |
"__pycache__" | |
"*\.o" | |
"*\.a" | |
) | |
: ${1?} | |
TARGET="${1}" | |
for pat in ${PATTERN[@]}; do | |
founded=($(find "${TARGET}" -name "${pat}" -print)) | |
if [ "${#founded[@]}" == "0" ]; then | |
printf "[%b] pattern [%s] found nothing\n" "\x1b[32m*\x1b[0m" "${pat}" | |
else | |
rm -rf ${founded[@]} | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment