fix zsh hist with no new line at the end

This commit is contained in:
xiongdian.me 2023-02-01 20:01:01 +08:00
parent d493ad9e2d
commit 81e83ab956

View File

@ -9,7 +9,9 @@ do_append()
{
timestamp=$(date +%s)
while read -r line; do
if [[ -n "$line" ]]; then
echo ": $timestamp:0;$line" >> "$zsh_hist_file"
fi
done
}
@ -24,7 +26,7 @@ main()
if [[ -z "$k" ]]; then
continue
fi
curl -fsSL "https://pastebin.com/raw/$k" | do_append
(curl -fsSL "https://pastebin.com/raw/$k" && echo) | do_append
done
}