mirror of
				https://github.com/lingble/twenty.git
				synced 2025-11-04 06:37:56 +00:00 
			
		
		
		
	Check if user wants to run make postgres-on-linux (#6819)
Fix #6319 Now script checks if user wants to run the script, the default is no, so user has explicitly type `y` or `Y` in order to run it.
This commit is contained in:
		@@ -20,6 +20,12 @@ handle_error () {
 | 
			
		||||
    exit 1
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
read -p "This script uses sudo to install postgresql, curl and change different settings, do you want to run this script? [y/N]" AGREEMENT
 | 
			
		||||
 | 
			
		||||
if ! echo "$AGREEMENT" | grep -iq "^y"; then
 | 
			
		||||
  exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
cat << "EOF"
 | 
			
		||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | 
			
		||||
@@@@@@@#*+=================@@@@@%*+=========++*%@@@@@@@
 | 
			
		||||
@@ -56,7 +62,7 @@ echo_header $GREEN "Step [1/4]: Installing PostgreSQL..."
 | 
			
		||||
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
 | 
			
		||||
wget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo tee /etc/apt/trusted.gpg.d/pgdg.asc &>/dev/null
 | 
			
		||||
sudo apt update -y || handle_error "Failed to update package list."
 | 
			
		||||
sudo apt install -y postgresql-$PG_MAIN_VERSION postgresql-contrib-$PG_MAIN_VERSION || handle_error "Failed to install PostgreSQL."su
 | 
			
		||||
sudo apt install -y postgresql-$PG_MAIN_VERSION postgresql-contrib-$PG_MAIN_VERSION || handle_error "Failed to install PostgreSQL."
 | 
			
		||||
sudo apt install -y curl || handle_error "Failed to install curl."
 | 
			
		||||
 | 
			
		||||
# Install pg_graphql extensions
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user