Fixs/reviews setups (#3067)

* update syntax to POSIX

The function keyword is not recognize by every POSIX-compliant shell.  The function keyword is a bashism, a bash extension. POSIX syntax does not use function and mandates the use of parenthesis.

This commit fixes the two issues :
./linux/provision-postgres-linux.sh: 9: function: not found
./linux/provision-postgres-linux.sh: 15: Syntax error: "}" unexpected

* update path init.sql

* update steps numbers yarn setup

There were two number 3's, everything should be correct now.

* delete useless -e
This commit is contained in:
Varrooo
2023-12-19 15:20:13 +01:00
committed by GitHub
parent e799c84233
commit 0f7ddd2f14
2 changed files with 10 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# Colors
RED=31
@@ -6,16 +6,16 @@ GREEN=32
BLUE=34
# Function to display colored output
function echo_header {
echo_header () {
COLOR=$1
MESSAGE=$2
echo -e "\e[${COLOR}m\n=======================================================\e[0m"
echo -e "\e[${COLOR}m${MESSAGE}\e[0m"
echo -e "\e[${COLOR}m=======================================================\e[0m"
echo "\e[${COLOR}m\n=======================================================\e[0m"
echo "\e[${COLOR}m${MESSAGE}\e[0m"
echo "\e[${COLOR}m=======================================================\e[0m"
}
# Function to handle errors
function handle_error {
handle_error () {
echo_header $RED "Error: $1"
exit 1
}
@@ -75,5 +75,5 @@ fi
# Run the init.sql to setup database
echo_header $GREEN "Step [4/4]: Setting up database..."
cp ./postgres/init.sql /tmp/init.sql
cp ./init.sql /tmp/init.sql
sudo -u postgres psql -f /tmp/init.sql || handle_error "Failed to execute init.sql script."