Skip to content

Commit

Permalink
xseed.sh v2.1.1 fix initial logging
Browse files Browse the repository at this point in the history
don't tee if log file not yet ingested
  • Loading branch information
bakerboy448 authored Aug 11, 2024
1 parent cb7077d commit c8ec860
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions xseed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,22 @@

# Load environment variables from .env file if it exists
# in the same directory as this bash script
VERSION='2.1.0'
VERSION='2.1.1'
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ENV_PATH="$SCRIPT_DIR/.env"

# Function to log messages
log_message() {
local log_type="$1"
local message="$2"
echo "$(date '+%Y-%m-%d %H:%M:%S') [$log_type] $message" | tee -a "$LOG_FILE"
local log_line="$(date '+%Y-%m-%d %H:%M:%S') [$log_type] $message"
if [ -f "$LOG_FILE" ]; then
echo "$log_line" | tee -a "$LOG_FILE"
else
echo "$log_line"
fi
}

log_message "INFO" "xseed.sh script started $VERSION"
EVAR=false
if [ -f "$ENV_PATH" ]; then
Expand Down

0 comments on commit c8ec860

Please sign in to comment.