Skip to content

Commit f26cbfe

Browse files
committed
Use a script that works on linux
1 parent 9f5afe5 commit f26cbfe

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

infra/dcp/update_image_tag.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ echo "📝 Updating $TFVARS_FILE..."
8181

8282
# Check if dcp_image_tag already exists
8383
if grep -q "^dcp_image_tag" "$TFVARS_FILE"; then
84-
# Use sed to replace the line. (Special syntax for macOS)
85-
sed -i '' "s/^dcp_image_tag.*/dcp_image_tag = \"$TAG\"/" "$TFVARS_FILE"
84+
# Replace the line using a temporary file for cross-platform compatibility (macOS/Linux)
85+
sed "s/^dcp_image_tag.*/dcp_image_tag = \"$TAG\"/" "$TFVARS_FILE" > "${TFVARS_FILE}.tmp" && mv "${TFVARS_FILE}.tmp" "$TFVARS_FILE"
8686
else
8787
# Append to end of file if it doesn't exist
8888
echo "" >> "$TFVARS_FILE"

0 commit comments

Comments
 (0)