-
Notifications
You must be signed in to change notification settings - Fork 1
/
preview.sh
executable file
·46 lines (37 loc) · 1.03 KB
/
preview.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
# {{{ shapes
echo "[]" > "./previewer/config/shapes.json"
for MY_PATH in "./templates/shapes/"*
do
MY_NAME="${MY_PATH/*\//}"
MY_NAME="${MY_NAME%.*}"
echo "$( cat "./previewer/config/shapes.json" | jq --arg name "${MY_NAME}" '. += [{
"value": $name,
"label": $name,
}]' )" > "./previewer/config/shapes.json"
done
# }}}
# {{{ backgrounds
echo "[]" > "./previewer/config/backgrounds.json"
for MY_PATH in "./templates/backgrounds/"*
do
MY_NAME="${MY_PATH/*\//}"
MY_NAME="${MY_NAME%.*}"
echo "$( cat "./previewer/config/backgrounds.json" | jq --arg name "${MY_NAME}" '. += [{
"value": $name,
"label": $name,
}]' )" > "./previewer/config/backgrounds.json"
done
# }}}
# {{{ shapes
echo "[]" > "./previewer/config/colors.json"
for MY_PATH in "./templates/colors/"*
do
MY_NAME="${MY_PATH/*\//}"
MY_NAME="${MY_NAME%.*}"
echo "$( cat "./previewer/config/colors.json" | jq --arg name "${MY_NAME}" '. += [{
"value": $name,
"label": $name,
}]' )" > "./previewer/config/colors.json"
done
# }}}