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:
parent
0ab946ac80
commit
2a80e9368d
1 changed files with 7 additions and 6 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue