Clarified comment of when newline should be added

Co-authored-by: 罗泽轩 <spacewanderlzx@gmail.com>
This commit is contained in:
tfendin 2021-12-30 12:47:29 +01:00 committed by GitHub
parent 11640196b2
commit fff5fde917
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,7 +58,7 @@ function add_patterns {
echo "Adding pattern(s) to: $1"
local file="${1/#~/$HOME}"
if [ -s "$file" ]; then
# If $file doesn't end with a newline, add one
# If the content of $file doesn't end with a newline, add one
test "$(tail -c 1 "$file")" != "" && echo "" >> "$file"
fi
for pattern in "${@:2}"; do