From 648f75df13c2e0fa73c5f1b0d271c8235188bc44 Mon Sep 17 00:00:00 2001 From: Darioush Jalali Date: Wed, 21 Aug 2024 11:48:39 -0700 Subject: [PATCH] portable sed --- scripts/apply_diff_and_rename.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/apply_diff_and_rename.sh b/scripts/apply_diff_and_rename.sh index 50c1392141..d160c8c10f 100755 --- a/scripts/apply_diff_and_rename.sh +++ b/scripts/apply_diff_and_rename.sh @@ -22,7 +22,11 @@ else fi # TODO: improve this command that finds all the "coreth" references and replaces them with "subnet-evm" -LANG=C find . -type f \! -name 'apply_diff_and_rename.sh' \! -path './.git/*' \! -path './contracts/node_modules/*' -exec sed -i '' -e "${sed_command}" {} \; +sed_inplace=(sed -i) # Linux +if [[ $(uname) == "Darwin" ]]; then + sed_inplace=(sed -i '') +fi +LANG=C find . -type f \! -name 'apply_diff_and_rename.sh' \! -path './.git/*' \! -path './contracts/node_modules/*' -exec "${sed_inplace[@]}" -e "${sed_command}" {} \; gofmt -w . go mod tidy