Skip to content

Commit 2a80e93

Browse files
authored
Update entrypoint.sh
1 parent 0ab946a commit 2a80e93

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

entrypoint.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ echo "Validated postgresql version: $INPUT_POSTGRESQL_VERSION"
2222

2323
echo "Installing postgresql..."
2424

25-
echo "OS: $(uname -s)"
25+
OS=$(uname -s)
26+
echo "OS: $OS"
2627

27-
if [[ "$(uname -s)" == "Linux" ]]; then
28+
if [[ "$OS" == "Linux" ]]; then
2829
# Create the file repository configuration:
2930
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
3031

@@ -36,9 +37,9 @@ if [[ "$(uname -s)" == "Linux" ]]; then
3637

3738
# Install PostgreSQL
3839
sudo apt-get install -y "postgresql-$INPUT_POSTGRESQL_VERSION"
39-
elif [[ "$(uname -s)" == "NT"* ]] || [[ "$(uname -s)" == "MINGW"* ]] || [[ "$(uname -s)" == *"MSYS"* ]]; then
40+
elif [[ "$OS" == "NT"* ]] || [[ "$OS" == "MINGW"* ]] || [[ "$OS" == *"MSYS"* ]]; then
4041
choco install "postgresql$INPUT_POSTGRESQL_VERSION" -y --no-progress --use-download-cache
41-
elif [[ "$(uname -s)" == "Darwin" ]]; then
42+
elif [[ "$OS" == "Darwin" ]]; then
4243
HOMEBREW_NO_AUTO_UPDATE=1 brew install "postgresql@$INPUT_POSTGRESQL_VERSION"
4344
else
4445
echo "Unsupported OS"
@@ -49,10 +50,10 @@ echo "Installed postgresql"
4950

5051
echo "Updating PATH..."
5152

52-
if [[ "$(uname -s)" == "NT"* ]] || [[ "$(uname -s)" == "MINGW"* ]] || [[ "$(uname -s)" == *"MSYS"* ]]; then
53+
if [[ "$OS" == "NT"* ]] || [[ "$OS" == "MINGW"* ]] || [[ "$OS" == *"MSYS"* ]]; then
5354
# shellcheck disable=SC2028
5455
echo "C:\\Program Files\\PostgreSQL\\$INPUT_POSTGRESQL_VERSION\\bin" >> "$GITHUB_PATH"
55-
elif [[ "$(uname -s)" == "Darwin" ]]; then
56+
elif [[ "$OS" == "Darwin" ]]; then
5657
echo "$(brew --prefix postgresql@"${INPUT_POSTGRESQL_VERSION}")/bin" >> "$GITHUB_PATH"
5758
else
5859
echo "/usr/lib/postgresql/$INPUT_POSTGRESQL_VERSION/bin" >> "$GITHUB_PATH"

0 commit comments

Comments
 (0)