-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: css link added throught github action
- Loading branch information
1 parent
40bc652
commit bc09125
Showing
2 changed files
with
28 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# Find the CSS file in the assets directory | ||
CSS_FILE=$(find ./build/client/assets -name "root*.css" -type f) | ||
|
||
if [ -z "$CSS_FILE" ]; then | ||
echo "No CSS file found in ./build/client/assets" | ||
exit 1 | ||
fi | ||
|
||
# Get just the filename from the path | ||
CSS_FILENAME=$(basename "$CSS_FILE") | ||
|
||
# Update the index.html file to include the CSS link | ||
# First, check if a CSS link already exists | ||
if grep -q "<link.*rel=\"stylesheet\".*>" ./build/client/index.html; then | ||
# Update existing CSS link | ||
sed -i "s|<link.*rel=\"stylesheet\".*>|<link rel=\"stylesheet\" href=\"/assets/$CSS_FILENAME\">|" ./build/client/index.html | ||
else | ||
# Add new CSS link before closing head tag | ||
sed -i "s|</head>|<link rel=\"stylesheet\" href=\"/assets/$CSS_FILENAME\">\n</head>|" ./build/client/index.html | ||
fi | ||
|
||
echo "Updated index.html with CSS link: $CSS_FILENAME" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters