Files
mahjong/иконки/2019-09-12/ген

28 lines
508 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Создать файл JavaScript с набором иконок в формате Base64.
function gen
{
name=$1
fileName=$2
target=$3
echo -n "'$name' : '" >> $target
base64 $fileName | tr -d \\n >> $target
echo -e "',\n" >> $target
}
function genIcons
{
target=$1
echo -e "function RR() { return {\n" > $target
gen "layout" "boxes-solid.svg" $target
gen "info" "info-solid.svg" $target
echo "}; }" >> $target
}
genIcons "../2019-09-12.js"