Skip to content

Commit 43b0ebd

Browse files
authored
Adding sed compatibility for MacOS (#520)
1 parent 57b596c commit 43b0ebd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

template/default.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ rec {
114114
# (see https://github.com/pre-commit/pre-commit-hooks?tab=readme-ov-file#trailing-whitespace).
115115
# So, remove the trailing newline already here to avoid that an
116116
# unnecessary change is shown in Git.
117-
sed -i '$d' Cargo.nix
117+
if [[ "$(uname)" == "Darwin" ]]; then
118+
sed -i \"\" '$d' Cargo.nix
119+
else
120+
sed -i '$d' Cargo.nix
121+
fi
118122
'';
119123
}

0 commit comments

Comments
 (0)