Using formatting message functions to better display the messages

This commit is contained in:
Roger Gonzalez 2023-10-21 17:17:09 -03:00
parent 9ba61badad
commit 3ecbb4477b
Signed by: rogs
GPG Key ID: C7ECE9C6C36EC2E6
2 changed files with 24 additions and 24 deletions

View File

@ -392,9 +392,9 @@ directory.
echo -e "\nWe need your sudo password to install the YAMS CLI and configure permissions..."
if sudo cp yams /usr/local/bin/yams && sudo chmod +x /usr/local/bin/yams; then
echo "YAMS CLI installed successfully."
send_success_message "YAMS CLI installed successfully ✅"
else
send_error_message "Failed to install YAMS CLI. Make sure you have the necessary permissions."
send_error_message "Failed to install YAMS CLI. Make sure you have the necessary permissions"
fi
#+end_src
@ -408,19 +408,19 @@ it will raise an error.
#+begin_src bash
if [[ -d "$media_folder" ]]; then
echo "Media folder \"$media_folder\" exists."
send_success_message "Media folder \"$media_folder\" exists ✅"
else
if sudo mkdir -p "$media_folder"; then
echo "Media folder \"$media_folder\" created."
send_success_message "Media folder \"$media_folder\" created ✅"
else
send_error_message "Failed to create or access the media folder. Check permissions."
send_error_message "Failed to create or access the media folder. Check permissions"
fi
fi
if sudo chown -R "$puid":"$pgid" "$media_folder"; then
echo "Media folder ownership and permissions set successfully."
send_success_message "Media folder ownership and permissions set successfully ✅"
else
send_error_message "Failed to set ownership and permissions for the media folder. Check permissions."
send_error_message "Failed to set ownership and permissions for the media folder. Check permissions"
fi
#+end_src
@ -434,19 +434,19 @@ it can't be created, we'll raise an error.
#+begin_src bash
if [[ -d "$install_location/config" ]]; then
echo "Configuration folder \"$install_location/config\" exists."
send_success_message "Configuration folder \"$install_location/config\" exists ✅"
else
if sudo mkdir -p "$install_location/config"; then
echo "Configuration folder \"$install_location/config\" created."
send_success_message "Configuration folder \"$install_location/config\" created ✅"
else
send_error_message "Failed to create or access the configuration folder. Check permissions."
send_error_message "Failed to create or access the configuration folder. Check permissions"
fi
fi
if sudo chown -R "$puid":"$pgid" "$install_location/config"; then
echo "Configuration folder ownership and permissions set successfully."
send_success_message "Configuration folder ownership and permissions set successfully ✅"
else
send_error_message "Failed to set ownership and permissions for the configuration folder. Check permissions."
send_error_message "Failed to set ownership and permissions for the configuration folder. Check permissions"
fi
#+end_src

View File

@ -219,41 +219,41 @@ docker-compose -f "$filename" up -d
echo -e "\nWe need your sudo password to install the YAMS CLI and configure permissions..."
if sudo cp yams /usr/local/bin/yams && sudo chmod +x /usr/local/bin/yams; then
echo "YAMS CLI installed successfully."
send_success_message "YAMS CLI installed successfully ✅"
else
send_error_message "Failed to install YAMS CLI. Make sure you have the necessary permissions."
send_error_message "Failed to install YAMS CLI. Make sure you have the necessary permissions"
fi
if [[ -d "$media_folder" ]]; then
echo "Media folder \"$media_folder\" exists."
send_success_message "Media folder \"$media_folder\" exists ✅"
else
if sudo mkdir -p "$media_folder"; then
echo "Media folder \"$media_folder\" created."
send_success_message "Media folder \"$media_folder\" created ✅"
else
send_error_message "Failed to create or access the media folder. Check permissions."
send_error_message "Failed to create or access the media folder. Check permissions"
fi
fi
if sudo chown -R "$puid":"$pgid" "$media_folder"; then
echo "Media folder ownership and permissions set successfully."
send_success_message "Media folder ownership and permissions set successfully ✅"
else
send_error_message "Failed to set ownership and permissions for the media folder. Check permissions."
send_error_message "Failed to set ownership and permissions for the media folder. Check permissions"
fi
if [[ -d "$install_location/config" ]]; then
echo "Configuration folder \"$install_location/config\" exists."
send_success_message "Configuration folder \"$install_location/config\" exists ✅"
else
if sudo mkdir -p "$install_location/config"; then
echo "Configuration folder \"$install_location/config\" created."
send_success_message "Configuration folder \"$install_location/config\" created ✅"
else
send_error_message "Failed to create or access the configuration folder. Check permissions."
send_error_message "Failed to create or access the configuration folder. Check permissions"
fi
fi
if sudo chown -R "$puid":"$pgid" "$install_location/config"; then
echo "Configuration folder ownership and permissions set successfully."
send_success_message "Configuration folder ownership and permissions set successfully ✅"
else
send_error_message "Failed to set ownership and permissions for the configuration folder. Check permissions."
send_error_message "Failed to set ownership and permissions for the configuration folder. Check permissions"
fi
printf "\033c"