From 3ecbb4477b6857076013b8c930cef798307d6a46 Mon Sep 17 00:00:00 2001 From: Roger Gonzalez Date: Sat, 21 Oct 2023 17:17:09 -0300 Subject: Using formatting message functions to better display the messages --- docs.org | 24 ++++++++++++------------ install.sh | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/docs.org b/docs.org index 7d1758e..c69eee8 100644 --- a/docs.org +++ b/docs.org @@ -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 diff --git a/install.sh b/install.sh index 54f51df..5eff501 100644 --- a/install.sh +++ b/install.sh @@ -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" -- cgit v1.2.3