Skip to content

Commit 81817b9

Browse files
committed
Make pages artifact rewrite portable on macOS
1 parent c8bd007 commit 81817b9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.github/workflows/deploy-github-pages.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,10 @@ jobs:
225225
run: |
226226
mkdir -p "$PAGES_ARTIFACT_ROOT"
227227
cp -R "$PUBLISH_ROOT/wwwroot/." "$PAGES_ARTIFACT_ROOT/"
228-
sed -i "s#<base href=\"/\" />#<base href=\"${PAGES_BASE_PATH}\" />#g" "$PAGES_ARTIFACT_ROOT/index.html"
228+
pages_index_path="$PAGES_ARTIFACT_ROOT/index.html"
229+
pages_index_temp_path="$PAGES_ARTIFACT_ROOT/index.html.tmp"
230+
sed "s#<base href=\"/\" />#<base href=\"${PAGES_BASE_PATH}\" />#g" "$pages_index_path" > "$pages_index_temp_path"
231+
mv "$pages_index_temp_path" "$pages_index_path"
229232
cp "$PAGES_ARTIFACT_ROOT/index.html" "$PAGES_ARTIFACT_ROOT/404.html"
230233
printf '%s\n' "$PAGES_CNAME" > "$PAGES_ARTIFACT_ROOT/CNAME"
231234
touch "$PAGES_ARTIFACT_ROOT/.nojekyll"

0 commit comments

Comments
 (0)