Skip to content

Commit

Permalink
Merge branch 'feature/FAST-1766-transform-google-font-urls-for-discor…
Browse files Browse the repository at this point in the history
…d-activity' into staging
  • Loading branch information
danielxvu committed Nov 14, 2024
2 parents b18bd73 + 2a6f5ee commit 823d4cf
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions process-fonts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ extract_font_urls() {
# Process each directory
for dir in ${dirs[@]}; do
print "Checking directory: $dir" >&2
mkdir -p "$output_dir/$dir"

# Find CSS files directly in this directory
css_files=($dir/*.css(.N))
Expand Down Expand Up @@ -110,6 +111,7 @@ for dir in ${dirs[@]}; do

if [[ "$response" != "y" ]]; then
print "Skipping $dir" >&2
touch "$output_dir/$dir/fonts.css"
continue
fi
fi
Expand Down Expand Up @@ -140,11 +142,18 @@ for dir in ${dirs[@]}; do
done

if [[ -s "$raw_file" ]]; then
# Create directory for this sheet
mkdir -p "$output_dir/$dir"
mv "$raw_file" "$output_dir/$dir/fonts.css"
print "Generated fonts.css for $dir" >&2
else
touch "$output_dir/$dir/fonts.css"
print "Generated empty fonts.css for $dir (no valid content)" >&2
fi
else
touch "$output_dir/$dir/fonts.css"
print "Generated empty fonts.css for $dir (no URLs found)" >&2
fi
else
touch "$output_dir/$dir/fonts.css"
print "Generated empty fonts.css for $dir (no CSS files)" >&2
fi
done

0 comments on commit 823d4cf

Please sign in to comment.