diff --git a/create-db b/create-db index ce40b4a..75f6f4f 100755 --- a/create-db +++ b/create-db @@ -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 diff --git a/delete-db b/delete-db index c613316..c9d459c 100755 --- a/delete-db +++ b/delete-db @@ -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