From 0782aa6eb865a94534c77170275d5d1acbf74536 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 22 Feb 2023 07:55:08 +0000 Subject: [PATCH] feat(postgres): install to macOS /Applications/ rather than ~/Applications/ (works better) --- postgres/install.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/postgres/install.sh b/postgres/install.sh index 15b28ef..6b2c0dd 100644 --- a/postgres/install.sh +++ b/postgres/install.sh @@ -28,11 +28,19 @@ pkg_link() { # rm -f "$HOME/.local/opt/postgres" rm -f "$pkg_dst" rm -f "$HOME/Applications/pgAdmin"*.app || true + rm -f "/Applications/pgAdmin"*.app || true # ln -s "$HOME/.local/opt/postgres-v10.13" "$HOME/.local/opt/postgres" ln -s "$pkg_src" "$pkg_dst" - mkdir -p ~/Applications - ln -s "$pkg_src/pgAdmin 4.app" "$HOME/Applications/pgAdmin 4.app" || true + if [ "Darwin" = "$(uname -s)" ]; then + mkdir -p /Applications + ln -s "$pkg_src/pgAdmin 4.app" "/Applications/pgAdmin 4.app" || true + if [ -e "$pkg_src/pgAdmin 4.app/Contents/Resources/venv/lib/libpython3.8.dylib" ]; then + # a simple patch to fix the bad link in the package + rm "$pkg_src/pgAdmin 4.app/Contents/Resources/venv/lib/libpython3.8.dylib" + ln -s "../../../Frameworks/Python" "$pkg_src/pgAdmin 4.app/Contents/Resources/venv/lib/libpython3.8.dylib" + fi + fi } pkg_post_install() {