0
0
Fork 0
mirror of https://github.com/tj-actions/install-postgresql.git synced 2024-12-20 01:18:18 +00:00

Update entrypoint.sh

This commit is contained in:
Tonye Jack 2024-05-12 12:21:22 -06:00 committed by GitHub
parent 0ab946ac80
commit 2a80e9368d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,9 +22,10 @@ echo "Validated postgresql version: $INPUT_POSTGRESQL_VERSION"
echo "Installing postgresql..."
echo "OS: $(uname -s)"
OS=$(uname -s)
echo "OS: $OS"
if [[ "$(uname -s)" == "Linux" ]]; then
if [[ "$OS" == "Linux" ]]; then
# Create the file repository configuration:
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
@ -36,9 +37,9 @@ if [[ "$(uname -s)" == "Linux" ]]; then
# Install PostgreSQL
sudo apt-get install -y "postgresql-$INPUT_POSTGRESQL_VERSION"
elif [[ "$(uname -s)" == "NT"* ]] || [[ "$(uname -s)" == "MINGW"* ]] || [[ "$(uname -s)" == *"MSYS"* ]]; then
elif [[ "$OS" == "NT"* ]] || [[ "$OS" == "MINGW"* ]] || [[ "$OS" == *"MSYS"* ]]; then
choco install "postgresql$INPUT_POSTGRESQL_VERSION" -y --no-progress --use-download-cache
elif [[ "$(uname -s)" == "Darwin" ]]; then
elif [[ "$OS" == "Darwin" ]]; then
HOMEBREW_NO_AUTO_UPDATE=1 brew install "postgresql@$INPUT_POSTGRESQL_VERSION"
else
echo "Unsupported OS"
@ -49,10 +50,10 @@ echo "Installed postgresql"
echo "Updating PATH..."
if [[ "$(uname -s)" == "NT"* ]] || [[ "$(uname -s)" == "MINGW"* ]] || [[ "$(uname -s)" == *"MSYS"* ]]; then
if [[ "$OS" == "NT"* ]] || [[ "$OS" == "MINGW"* ]] || [[ "$OS" == *"MSYS"* ]]; then
# shellcheck disable=SC2028
echo "C:\\Program Files\\PostgreSQL\\$INPUT_POSTGRESQL_VERSION\\bin" >> "$GITHUB_PATH"
elif [[ "$(uname -s)" == "Darwin" ]]; then
elif [[ "$OS" == "Darwin" ]]; then
echo "$(brew --prefix postgresql@"${INPUT_POSTGRESQL_VERSION}")/bin" >> "$GITHUB_PATH"
else
echo "/usr/lib/postgresql/$INPUT_POSTGRESQL_VERSION/bin" >> "$GITHUB_PATH"