You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2026/09/01 10:22:34 UTC
(camel-quarkus-examples) 01/04: refresh-dockerfiles.sh: make sed in-place edit portable across GNU and BSD
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch camel-quarkus-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus-examples.git
commit 5be34ee2e2573b309168da29371c954e16413c07
Author: Jiri Ondrusek <on...@gmail.com>
AuthorDate: Thu Aug 27 11:46:20 2026 +0200
refresh-dockerfiles.sh: make sed in-place edit portable across GNU and BSD
The script used BSD/macOS-only 'sed -i ""' syntax, which fails on Linux
(GNU sed) because the empty string is parsed as the sed script and the
real expression is treated as a filename. Replace it with a portable
temp-file approach that works on both Fedora and macOS.
Co-Authored-By: Claude Opus 4.8 (1M context) <no...@anthropic.com>
---
refresh-dockerfiles.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/refresh-dockerfiles.sh b/refresh-dockerfiles.sh
index ac02dfe1..2f14941c 100755
--- a/refresh-dockerfiles.sh
+++ b/refresh-dockerfiles.sh
@@ -78,7 +78,7 @@ for EXAMPLE_DIR in */; do
for DOCKERFILE in "$TARGET_DOCKER_DIR"/*; do
if [ -f "$DOCKERFILE" ]; then
echo " - Replacing 'temp-quarkus-project' with '$PROJECT_NAME' in $DOCKERFILE"
- sed -i "" "s/temp-quarkus-project/$PROJECT_NAME/g" "$DOCKERFILE"
+ sed "s/temp-quarkus-project/$PROJECT_NAME/g" "$DOCKERFILE" > "$DOCKERFILE.tmp" && mv "$DOCKERFILE.tmp" "$DOCKERFILE"
fi
done
echo " - Running mvn license:format in $EXAMPLE_DIR"