mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-24 23:15:39 +00:00
make log
output to stderr
This commit is contained in:
parent
15657f396c
commit
5db5fcb407
|
@ -34,7 +34,7 @@ find_compatible_compression_format() {
|
|||
local normalized_filename=$(echo "$1" | tr '[:upper:]' '[:lower:]')
|
||||
local system=$(echo "$1" | grep -oE "$roms_folder/[^/]+" | grep -oE "[^/]+$")
|
||||
|
||||
if [[ $(validate_for_chd "$1") == *"true" ]] && [[ $(sed -n '/^\[/{h;d};/\b'"$system"'\b/{g;s/\[\(.*\)\]/\1/p;q};' $compression_targets) == "chd" ]]; then
|
||||
if [[ $(validate_for_chd "$1") == "true" ]] && [[ $(sed -n '/^\[/{h;d};/\b'"$system"'\b/{g;s/\[\(.*\)\]/\1/p;q};' $compression_targets) == "chd" ]]; then
|
||||
echo "chd"
|
||||
elif grep -qF ".${normalized_filename##*.}" $zip_compressable_extensions && [[ $(sed -n '/^\[/{h;d};/\b'"$system"'\b/{g;s/\[\(.*\)\]/\1/p;q};' $compression_targets) == "zip" ]]; then
|
||||
echo "zip"
|
||||
|
|
|
@ -86,11 +86,11 @@ log() {
|
|||
esac
|
||||
|
||||
# Display the message in the terminal
|
||||
echo -e "$colored_message"
|
||||
echo -e "$colored_message" >&2
|
||||
|
||||
# Write the log message to the log file
|
||||
if [ ! -f "$logfile" ]; then
|
||||
echo "$timestamp [WARN] Log file not found in \"$logfile\", creating it"
|
||||
echo "$timestamp [WARN] Log file not found in \"$logfile\", creating it" >&2
|
||||
touch "$logfile"
|
||||
fi
|
||||
echo "$log_message" >> "$logfile"
|
||||
|
|
Loading…
Reference in a new issue