File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 2626 echo -e " ${FMT_BOLD} No ${CL_OK} *.pyc${CL_RESET}${FMT_BOLD} files found.${FMT_RESET} "
2727fi
2828
29+ function clean_migrations {
30+ find $1 -not -name ' __init__.py' -not -type d -delete
31+ }
32+ export -f clean_migrations
33+
2934migrations=` find . -name migrations -not -path " */.git/*" `
3035if [ -n " $migrations " ]; then
3136 echo -e " ${FMT_BOLD} The following dirs will be deleted:${FMT_RESET} "
3237 for mig in $migrations ; do
3338 echo -e " \t$CL_ERR$mig$CL_RESET "
3439 done
35- confirm " Delete all files? [Y/n]" && find . -name migrations -not -path " */.git/*" -prune -exec rm -rf {} \;
40+ confirm " Delete all files? [Y/n]" && find . -name migrations -not -path " */.git/*" -prune -exec bash -c ' clean_migrations "$0" ' {} \;
3641else
3742 echo -e " ${FMT_BOLD} No ${CL_OK} migrations${CL_RESET}${FMT_BOLD} files found.${FMT_RESET} "
3843fi
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ function gitpath {
4141RESP=0
4242confirm " Auto confirm? [Y/n]" && RESP=1
4343
44- for i in ` find . -name ' .git' `
44+ for i in ` find . -maxdepth 2 - name ' .git' `
4545do
4646 DIR=$( dirname " ${i} " )
4747
You can’t perform that action at this time.
0 commit comments