From 092d31303532e88b691b714f98a3a32c74676c3f Mon Sep 17 00:00:00 2001 From: Maxi Wittich Date: Fri, 16 May 2025 13:07:57 +0200 Subject: [PATCH] Adding sed compatibility for MacOS --- template/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/template/default.nix b/template/default.nix index 263d8193..82f5928b 100644 --- a/template/default.nix +++ b/template/default.nix @@ -114,6 +114,10 @@ rec { # (see https://github.com/pre-commit/pre-commit-hooks?tab=readme-ov-file#trailing-whitespace). # So, remove the trailing newline already here to avoid that an # unnecessary change is shown in Git. - sed -i '$d' Cargo.nix + if [[ "$(uname)" == "Darwin" ]]; then + sed -i \"\" '$d' Cargo.nix + else + sed -i '$d' Cargo.nix + fi ''; }