-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
102 additions
and
1 deletion.
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,25 @@ | ||
#!/bin/bash | ||
|
||
# Define the path to the input SCSS file and the output file | ||
INPUT_FILE="src/fragments/_02a-font-faces.scss" | ||
OUTPUT_FILE="src/fragments/_02a-font-faces.scss.next" | ||
|
||
# Create/clear the output file | ||
> $OUTPUT_FILE | ||
|
||
# Process each line | ||
while IFS= read -r line | ||
do | ||
# Check if the line contains a [BASE64_STRING_HERE:path_to_file] pattern | ||
if [[ $line =~ \[BASE64_STRING_HERE:(.+)\] ]]; then | ||
# Extract the path from the match | ||
font_path="${BASH_REMATCH[1]}" | ||
# Base64 encode the font file | ||
encoded=$(gbase64 "$font_path" | tr -d '\n') | ||
# Replace the placeholder with the Base64 encoded string | ||
line=${line/\[BASE64_STRING_HERE:$font_path\]/$encoded} | ||
fi | ||
|
||
# Append the processed line to the output file | ||
echo "$line" >> $OUTPUT_FILE | ||
done < "$INPUT_FILE" |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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