summaryrefslogtreecommitdiffstats
path: root/pre-run.sh
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2020-06-20 15:43:28 +0100
committerPhilip Sargent <philip.sargent@klebos.com>2020-06-20 16:51:07 +0100
commite697466557b7ec370a0bd424a33b84074e41d564 (patch)
tree37bf6f095ccf281fb864a4a7947f21a36c315894 /pre-run.sh
parentb35a0b0d26303e61e20b320db9358ae425c49933 (diff)
downloadtroggle-e697466557b7ec370a0bd424a33b84074e41d564.tar.gz
troggle-e697466557b7ec370a0bd424a33b84074e41d564.tar.bz2
troggle-e697466557b7ec370a0bd424a33b84074e41d564.zip
Cleanup secrets management, pre-run checks.
Diffstat (limited to 'pre-run.sh')
-rw-r--r--pre-run.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/pre-run.sh b/pre-run.sh
new file mode 100644
index 0000000..aeec8f5
--- /dev/null
+++ b/pre-run.sh
@@ -0,0 +1,17 @@
+#! /bin/sh
+# Do these before final testing, *not* just before pushing:
+# Philip Sargent 2020/06/20
+python reset-django.py
+echo After cleanup deletion, remake all migrations.
+python manage.py makemigrations >/dev/null
+python manage.py test
+echo Run inspectdb:
+python manage.py inspectdb > troggle-inspectdb.py
+# egrep -in "unable|error" troggle-inspectdb.py
+echo ""
+# count non-blank lines of python and template HTML code
+# includes all variants of settings.py files
+find . -name \*.html -print0 | xargs -0 egrep -vc "#|^\s*$" | grep -v "0$" | awk -F ":" '{ sum +=$2; print $2, $1; } END {print sum}'| sort -n > lines-of-templates.txt
+
+find . -name \*.py -print0 | xargs -0 egrep -vc "#|^\s*$" | grep -v "0$" | awk -F ":" '{ sum +=$2; print $2, $1; } END {print sum}'| sort -n > lines-of-python.txt
+echo `tail -1 lines-of-python.txt` non-comment lines of python.