treehouse/scripts/mkicon.fish

8 lines
267 B
Fish
Executable file

#!/usr/bin/env fish
for filename in $argv
set icon_name (basename $filename .svg)
set icon_base64 (svgcleaner --stdout $filename 2>/dev/null | base64 -w0)
printf "--icon-%s: url('data:image/svg+xml;base64,%s');\n" "$icon_name" "$icon_base64" | sort
end