Always use the correct .databases file

Signed-off-by: fly <merspieler@airmail.cc>
This commit is contained in:
fly 2020-08-27 10:09:30 +00:00
parent 478524b2bd
commit 56e8d3e7da
2 changed files with 5 additions and 3 deletions

View file

@ -71,7 +71,7 @@ psql -d "$database" -f "$root_path"/sql/pgsnapshot_schema_0.6.sql
psql -d "$database" -f "$root_path"/sql/pgsnapshot_schema_0.6_bbox.sql
if [ ! -f ".databases" ]; then
touch .databases
touch "$root_path"/.databases
fi
echo "$database" >> .databases
echo "$database" >> "$root_path"/.databases

View file

@ -15,6 +15,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
root_path="$( cd "$(dirname "$0")" ; pwd -P )"
first=1
while [[ "$#" -gt 0 ]]
do
@ -44,4 +46,4 @@ esac
done
psql --dbname="postgres" -c "DROP DATABASE IF EXISTS \"$database\""
sed -ri "s/^$key$//" .databases
sed -ri "s/^$key$//" "$root_path"/.databases