forked from knowthelist/ftui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare_update.sh
executable file
·29 lines (26 loc) · 1 KB
/
prepare_update.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
#!/bin/bash
rm controls_ftui.txt
git ls-files -z | while IFS= read -r -d '' f;
do
if [[ $f != *.git* && $f != *.eslintrc* && $f == *www/ftui* ]]; then
if [[ ! -f "${f}" ]]; then
echo MOV "${f}" unused >> controls_ftui.txt
else
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
out="$(date -d "@$( stat -c '%Y' $f )" +'%F_%T') $(stat -c%s $f) ${f}"
#out="$(git log -1 --pretty="format:%ci" -- examples/badge.html | cut -f1-2 -d' ') $(stat -c%s $f) ${f}"
elif [[ "$OSTYPE" == "darwin"* ]]; then
out="$(stat -f "%Sm" -t "%Y-%m-%d_%T" $f) "$(stat -f%z $f)" ${f}"
#out="$(git log -1 --pretty="format:%ci" -- examples/badge.html | cut -f1-2 -d' ') $(stat -f%z $f) ${f}"
else
# other OSs needs to be added
out="${f}"
fi
if [[ $f == *index.html* ]]; then
echo CRE ${out//.\//} >> controls_ftui.txt
else
echo UPD ${out//.\//} >> controls_ftui.txt
fi
fi
fi
done