mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-28 16:45:42 +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 normalized_filename=$(echo "$1" | tr '[:upper:]' '[:lower:]')
|
||||||
local system=$(echo "$1" | grep -oE "$roms_folder/[^/]+" | grep -oE "[^/]+$")
|
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"
|
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
|
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"
|
echo "zip"
|
||||||
|
|
|
@ -86,11 +86,11 @@ log() {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Display the message in the terminal
|
# Display the message in the terminal
|
||||||
echo -e "$colored_message"
|
echo -e "$colored_message" >&2
|
||||||
|
|
||||||
# Write the log message to the log file
|
# Write the log message to the log file
|
||||||
if [ ! -f "$logfile" ]; then
|
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"
|
touch "$logfile"
|
||||||
fi
|
fi
|
||||||
echo "$log_message" >> "$logfile"
|
echo "$log_message" >> "$logfile"
|
||||||
|
|
Loading…
Reference in a new issue