-
Notifications
You must be signed in to change notification settings - Fork 0
/
size.sh
executable file
·26 lines (20 loc) · 1003 Bytes
/
size.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
cp /dev/null size.md
{
echo "# list of all the theme version's size"
echo ""
echo "#### size is counted as bytes"
echo ""
echo "| file name | json | json min | css class | css class min | css var | css var min |"
echo "| :-------- | ---: | -------: | --------: | ------------: | ------: | ----------: |"
} >>size.md
for color in $(jq <themes.json -r ".[]"); do
JSON=$(du -b json/"$color".json | awk '{print $1}')
JSONMIN=$(du -b json-min/"$color".json | awk '{print $1}')
CSSCLASS=$(du -b css-class/"$color".css | awk '{print $1}')
CSSCLASSMIN=$(du -b css-class-min/"$color".css | awk '{print $1}')
CSSVAR=$(du -b css-var/"$color".css | awk '{print $1}')
CSSVARMIN=$(du -b css-var-min/"$color".css | awk '{print $1}')
echo "| $color | $JSON | $JSONMIN | $CSSCLASS | $CSSCLASSMIN | $CSSVAR | $CSSVARMIN |" >>size.md
done
echo "##### generated by [size.sh](https://github.com/z00rat/terminal-themes.css/blob/master/size.sh)" >>size.md