Ver Fonte

Taskfile: drop-test-db (#7623)

[skip ci]
Joe Chen há 1 ano atrás
pai
commit
41d473e999
1 ficheiros alterados com 9 adições e 0 exclusões
  1. 9 0
      Taskfile.yml

+ 9 - 0
Taskfile.yml

@@ -90,3 +90,12 @@ tasks:
     desc: Identify legacy and deprecated lines
     desc: Identify legacy and deprecated lines
     cmds:
     cmds:
       - grep -rnw "\(LEGACY\|Deprecated\)" internal
       - grep -rnw "\(LEGACY\|Deprecated\)" internal
+
+  drop-test-db:
+    desc: Drop the test database
+    cmds:
+      - |
+        for dbname in $(psql -Xc "copy (select datname from pg_database where datname like 'gogs-%') to stdout"); do
+          dropdb "$dbname"
+          echo "dropped $dbname"
+        done