X-Git-Url: https://git.josue.xyz/?p=webi-installers%2F.git;a=blobdiff_plain;f=postgres%2Finstall.sh;fp=postgres%2Finstall.sh;h=ca41f2c182baf94795244dae9c85e1ef96c324aa;hp=35d4625c68f222ace7136fb576cdffd53cf94a48;hb=ca7a838c6fde6052124947ff442aa9e6056f5e28;hpb=704265583cff80363fec60c4088f5b91f6d98bd0 diff --git a/postgres/install.sh b/postgres/install.sh index 35d4625..ca41f2c 100644 --- a/postgres/install.sh +++ b/postgres/install.sh @@ -1,3 +1,5 @@ +#!/bin/bash + set -e set -u @@ -6,7 +8,7 @@ pkg_cmd_name="postgres" POSTGRES_DATA_DIR=$HOME/.local/share/postgres/var -pkg_get_current_version() { +function pkg_get_current_version() { # 'postgres --version' has output in this format: # postgres (PostgreSQL) 10.13 # This trims it down to just the version number: @@ -14,7 +16,7 @@ pkg_get_current_version() { echo "$(postgres --version 2> /dev/null | head -n 1 | cut -d' ' -f3)" } -pkg_install() { +function pkg_install() { # mkdir -p $HOME/.local/opt mkdir -p "$(dirname $pkg_src)" @@ -22,7 +24,7 @@ pkg_install() { mv ./"p"* "$pkg_src" } -pkg_link() { +function pkg_link() { # rm -f "$HOME/.local/opt/postgres" rm -f "$pkg_dst" rm -f "$HOME/Applications/pgAdmin"*.app || true @@ -33,7 +35,7 @@ pkg_link() { ln -s "$pkg_src/pgAdmin 4.app" "$HOME/Applications/pgAdmin 4.app" || true } -pkg_post_install() { +function pkg_post_install() { webi_path_add "$pkg_dst_bin" #echo "Initializing PostgreSQL with database at $POSTGRES_DATA_DIR/" @@ -51,7 +53,7 @@ pkg_post_install() { fi } -pkg_done_message() { +function pkg_done_message() { # TODO show with serviceman echo "Installed 'postgres' and 'psql' at $pkg_dst" echo ""