Skip to content

Commit

Permalink
feat: env file merging MacOS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
av committed Sep 5, 2024
1 parent 474330e commit 6f6366f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion harbor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6f6366f

Please sign in to comment.