style(cli): carry glyph markers through the install scripts

Propagate the ✓ Success / ✗ Error / ! Notice / ❯ Question glyphs (from markers.sh) through the rest of the pipeline: swap the inlined helpers in init.sh and generate_arrays.sh, and replace raw echo -e "${RED}ERROR:${NC}" calls with the isX helpers in config_check_missing.sh, check_success.sh, initilize_files.sh, and reset_git.sh.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
This commit is contained in:
librelad 2026-05-22 13:25:59 +01:00
parent 5ce0a88de0
commit 300301e6aa
6 changed files with 21 additions and 21 deletions

View File

@ -24,10 +24,10 @@ YELLOW='\033[0;33m'
BLUE='\033[0;34m'
NC='\033[0m'
isSuccessful() { echo -e "${GREEN}SUCCESS:${NC} $1"; }
isError() { echo -e "${RED}ERROR:${NC} $1"; }
isNotice() { echo -e "${YELLOW}NOTICE:${NC} $1"; }
isQuestion() { echo -e -n "${BLUE}QUESTION:${NC} $1 "; }
isSuccessful() { echo -e "${GREEN}✓ Success${NC} $1"; }
isError() { echo -e "${RED}✗ Error${NC} $1"; }
isNotice() { echo -e "${YELLOW}! Notice${NC} $1"; }
isQuestion() { echo -e -n "${BLUE} Question${NC} $1 "; }
displayLibrePortalLogo() {
local hbar; hbar=$(printf '═%.0s' $(seq 1 50))

View File

@ -4,7 +4,7 @@ checkConfigFilesMissingFiles()
{
# Simply check if the configs directory exists and has some content
if [ ! -d "$configs_dir" ]; then
echo -e "${RED}ERROR:${NC} Configs directory not found at $configs_dir"
isError "Configs directory not found at $configs_dir"
return 1
fi
@ -41,12 +41,12 @@ checkConfigFilesMissingFiles()
if [ "$found_files_count" -gt 0 ]; then
if [ "$missing_files_count" -gt 0 ]; then
echo -e "${GREEN}SUCCESS:${NC} $missing_files_count config files were missing and have been added to the configs folder."
isSuccessful "$missing_files_count config files were missing and have been added to the configs folder."
else
echo -e "${GREEN}SUCCESS:${NC} All config files are successfully set up in the configs folder."
isSuccessful "All config files are successfully set up in the configs folder."
fi
else
echo -e "${YELLOW}NOTICE:${NC} No configuration files found in install directory. This may be a fresh installation."
isNotice "No configuration files found in install directory. This may be a fresh installation."
exit
fi
}

View File

@ -3,12 +3,12 @@
function checkSuccess()
{
if [ $? -eq 0 ]; then
echo -e "${GREEN}SUCCESS:${NC} $1"
isSuccessful "$1"
if [ -f "$logs_dir/$docker_log_file" ]; then
echo "SUCCESS: $1" | sudo tee -a "$logs_dir/$docker_log_file" >/dev/null
echo "✓ Success $1" | sudo tee -a "$logs_dir/$docker_log_file" >/dev/null
fi
else
echo -e "${RED}ERROR:${NC} $1"
isError "$1"
# Non-interactive (task processor / cron / piped): bail instead of
# blocking on read.

View File

@ -19,8 +19,8 @@ SCRIPTS_DIR="$(dirname "$(dirname "$SCRIPT_DIR")")"
# the script keeps its zero-dependency property but still matches the look of
# the rest of the install pipeline.
RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[0;33m'; NC='\033[0m'
isSuccessful() { echo -e "${GREEN}SUCCESS:${NC} $1"; }
isNotice() { echo -e "${YELLOW}NOTICE:${NC} $1"; }
isSuccessful() { echo -e "${GREEN}✓ Success${NC} $1"; }
isNotice() { echo -e "${YELLOW}! Notice${NC} $1"; }
isHeader() {
local title="$1"
local width=52

View File

@ -7,8 +7,8 @@ sourceInitilize()
# We will only show the header for the full app
if [[ $flag == "run" ]]; then
isHeader "Loading LibrePortal Startup Files"
echo -e "${YELLOW}NOTICE:${NC} If you are experiencing loading issues..."
echo -e "${YELLOW}NOTICE:${NC} Please run the following : 'libreportal reset'"
isNotice "If you are experiencing loading issues..."
isNotice "Please run the following : 'libreportal reset'"
fi
# Directory containing the files to source recursively
@ -40,7 +40,7 @@ sourceInitilize()
# Checking for missing files
for file_to_source in "${files_to_source[@]}"; do
if [ ! -f "${install_scripts_dir}${file_to_source}" ]; then
echo "NOTICE: Missing file: ${install_scripts_dir}${file_to_source}"
isNotice "Missing file: ${install_scripts_dir}${file_to_source}"
else
source "${install_scripts_dir}${file_to_source}"
#echo "Sourced file: ${install_scripts_dir}${file_to_source}"

View File

@ -4,7 +4,7 @@ gitReset()
{
# Check if this is a local installation
if [[ "$CFG_INSTALL_MODE" == "local" ]]; then
echo "NOTICE: Local installation detected - Git reset is not applicable."
isNotice "Local installation detected - Git reset is not applicable."
echo "To reset a local installation, please manually restore files and rerun the init script."
else
gitCheckGitDetails;
@ -31,11 +31,11 @@ gitReset()
# Try HTTPS first
if sudo -u $sudo_user_name git clone -q "$AUTH_HTTPS_REPO_URL" "$script_dir" 2>/dev/null; then
echo "SUCCESS: Git repository cloned via HTTPS into '$script_dir'."
isSuccessful "Git repository cloned via HTTPS into '$script_dir'."
else
# If HTTPS fails, try HTTP
if sudo -u $sudo_user_name git clone -q "$AUTH_HTTP_REPO_URL" "$script_dir" 2>/dev/null; then
echo "SUCCESS: Git repository cloned via HTTP into '$script_dir'."
isSuccessful "Git repository cloned via HTTP into '$script_dir'."
else
isError " Failed to clone repository via both HTTPS and HTTP."
exit 1
@ -43,11 +43,11 @@ gitReset()
fi
elif [[ $CFG_INSTALL_MODE == "local" ]]; then
if sudo -u $sudo_user_name git clone -q "https://${CLEAN_GIT_URL}.git" "$script_dir" 2>/dev/null; then
echo "SUCCESS: Git repository cloned via HTTPS into '$script_dir'."
isSuccessful "Git repository cloned via HTTPS into '$script_dir'."
else
# If HTTPS fails, try HTTP
if sudo -u $sudo_user_name git clone -q "http://${CLEAN_GIT_URL}.git" "$script_dir" 2>/dev/null; then
echo "SUCCESS: Git repository cloned via HTTP into '$script_dir'."
isSuccessful "Git repository cloned via HTTP into '$script_dir'."
fi
fi
fi