Skip to content

Commit 4cf4b1e

Browse files
committed
test: different variant of previous fix
1 parent 8d16355 commit 4cf4b1e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/actions/configure-gradle/action.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ runs:
1919
echo Setting distribution URL to: https://d2pjps8lqszrgq.cloudfront.net/gradle-$gradleVersion-bin.zip
2020
2121
# Detect OS and set appropriate sed option
22-
if [[ "$OSTYPE" == "darwin"* ]]; then
23-
SED_OPTS=(-i '') # macOS (BSD sed) requires an empty string after -i
22+
if sed --version 2>/dev/null | grep -q "GNU sed"; then
23+
SED_CMD="sed -i" # GNU sed (Linux)
2424
else
25-
SED_OPTS=(-i) # Linux (GNU sed) does not need an empty string
25+
SED_CMD="sed -i ''" # BSD sed (macOS)
2626
fi
2727
28-
sed -i "${SED_OPTS[@]}" "/distributionUrl/c\\
28+
# Replace the line containing "distributionUrl" with the new distributionUrl
29+
$SED_CMD "/distributionUrl/c\\
2930
distributionUrl=https://d2pjps8lqszrgq.cloudfront.net/gradle-$gradleVersion-bin.zip\\
3031
" ./gradle/wrapper/gradle-wrapper.properties

0 commit comments

Comments
 (0)