From ef5b71496d73beec54a8005b5ec9f0837610a45e Mon Sep 17 00:00:00 2001 From: chrysle Date: Tue, 27 Jun 2023 09:49:02 +0200 Subject: [PATCH] Fix macOS tests --- todo.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/todo.sh b/todo.sh index fb8d4bc..437cfee 100755 --- a/todo.sh +++ b/todo.sh @@ -491,7 +491,14 @@ replaceOrPrepend() fixMissingEndOfLine() { # Parameters: $1: todo file; empty means $TODO_FILE. - sed -i.bak -e '$a\' "${1:-$TODO_FILE}" + #if [ "$OSTYPE" == "linux-gnu" ]; then + # sed -i.bak -e '$a\' "${1:-$TODO_FILE}" + #else + # sed -i '' -n p "${1:-$TODO_FILE}" + #f + todo_path="${1:-$TODO_FILE}" + [[ -f $todo_path ]] || echo "Not existing: $todo_path" + [[ -f $todo_path && $(tail -c1 "$todo_path") ]] && echo "" >> "$todo_path" } uppercasePriority()