From 27dc4b4270481f7da877b31f122c03e6c0751811 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Sun, 28 Sep 2025 01:34:08 +0900 Subject: modified thesiah/snippets, modified bin/ylog --- mac/.local/bin/ylog | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'mac') diff --git a/mac/.local/bin/ylog b/mac/.local/bin/ylog index e339b2a..1cfc52f 100755 --- a/mac/.local/bin/ylog +++ b/mac/.local/bin/ylog @@ -107,13 +107,24 @@ pick_files() { # build exclude regex build_exre() { EXRE="" + TEMP_FILE="/tmp/.ylog_exre_$$" + rm -f "$TEMP_FILE" + { printf "%s\n" "${EXCLUDES:-}"; printf "%s\n" "${ADD_EXCLUDES:-}"; } | sed "/^$/d" | while IFS= read -r pat do esc=$(printf "%s" "$pat" | sed -E "s/[][^$.*/+?(){}|\\]/\\\\&/g") - if [ -z "$EXRE" ]; then EXRE="$esc"; else EXRE="$EXRE|$esc"; fi - printf "%s\n" "$EXRE" > "/tmp/.ylog_exre_$$" + if [ -s "$TEMP_FILE" ]; then + EXRE="$(cat "$TEMP_FILE")|$esc" + else + EXRE="$esc" + fi + printf "%s" "$EXRE" > "$TEMP_FILE" done - if [ -f "/tmp/.ylog_exre_$$" ]; then cat "/tmp/.ylog_exre_$$"; rm -f "/tmp/.ylog_exre_$$"; fi + + if [ -f "$TEMP_FILE" ]; then + cat "$TEMP_FILE" + rm -f "$TEMP_FILE" + fi } FILES_TMP="/tmp/.ylog_files_$$" -- cgit v1.2.3