File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ APP_HOME="$HOME_DIR/$APP_DIR"
1313# 2. Define default overridable variables
1414# The update period in days (e.g., 3 means check if the last_checked file is older than 3 days)
1515UPDATE_PERIOD=3
16+ # Logging level (default empty/silent; set to anything, e.g., 'DEBUG', to enable logging)
17+ LOG_LEVEL=
1618
1719# --- Configuration Loading ---
1820# Function to load configuration variables from a file
@@ -46,7 +48,10 @@ ARCHIVE_FILE="$CACHE_DIR/release.tgz"
4648LAST_CHECKED_FILE=" $CACHE_DIR /last_checked"
4749
4850LOG () {
49- echo " [Installer] $1 "
51+ # Only echo the log message if LOG_LEVEL is not empty
52+ if [ -n " $LOG_LEVEL " ]; then
53+ echo " [Installer] $1 "
54+ fi
5055}
5156
5257# Function to get the last modification timestamp of a file
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ set "APP_HOME=%HOME_DIR%\.%APP_DIR%"
1414rem 2. Define default overridable variables
1515rem The update period in days (e.g., 3 means check if the last_checked file is older than 3 days)
1616set UPDATE_PERIOD = 3
17+ rem Logging level (default empty/silent; set to anything, e.g., 'DEBUG', to enable logging)
18+ set LOG_LEVEL =
1719
1820rem --- Configuration Loading ---
1921rem Helper subroutine to load configuration from a file
@@ -50,7 +52,10 @@ set "LAST_CHECKED_FILE=%CACHE_DIR%\last_checked"
5052
5153rem Helper function for logging
5254:LOG
53- echo [Installer] %~1
55+ rem Only echo the log message if LOG_LEVEL is not empty
56+ if not " %LOG_LEVEL% " == " " (
57+ echo [Installer] %~1
58+ )
5459 goto :eof
5560
5661rem --- Core Logic Functions ---
You can’t perform that action at this time.
0 commit comments