From 6f6366ffd891a5bbbba5444cc33a3393b152ebda Mon Sep 17 00:00:00 2001 From: Ivan Charapanau Date: Thu, 5 Sep 2024 10:10:15 +0200 Subject: [PATCH] feat: env file merging MacOS fixes --- harbor.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/harbor.sh b/harbor.sh index d24e87e..5f8e67c 100755 --- a/harbor.sh +++ b/harbor.sh @@ -659,7 +659,11 @@ merge_env_files() { done < "$default_file" # Remove trailing newlines from the temp file - sed -i -e :a -e '/^\n*$/{$d;N;ba' -e '}' "$temp_file" + if [[ "$(uname)" == "Darwin" ]]; then + sed -i '' -e :a -e '/^\n*$/{$d;N;ba' -e '}' "$temp_file" + else + sed -i -e :a -e '/^\n*$/{$d;N;ba' -e '}' "$temp_file" + fi # Move the temporary file to replace the target file mv "$temp_file" "$target_file"