-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtree.sh
More file actions
executable file
·60 lines (60 loc) · 1.46 KB
/
tree.sh
File metadata and controls
executable file
·60 lines (60 loc) · 1.46 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#
# Must be in the public folder when run (not good assumption)
#
# create the most up to date Bank List.
if [ -d Banks ]; then
(
cd Banks
find * -prune -type d -print >/tmp/bank-list.txt
[ -f "bank-list.txt" ] || touch -list.txt
if diff bank-list.txt /tmp/bank-list.txt; then
true
#echo bank-list.txt unchanged.
else
cat /tmp/bank-list.txt >bank-list.txt
echo bank-list.txt updated.
fi
rm /tmp/bank-list.txt
)
for dir in Banks/*/history; do
(
#echo "cd into $dir"
cd "$dir"
find * -prune -type d -print >/tmp/acct-list.txt
[ -f "acct-list.txt" ] || touch acct-list.txt
if diff acct-list.txt /tmp/acct-list.txt; then
true
#echo "$dir/acct-list.txt unchanged."
else
cat /tmp/acct-list.txt >acct-list.txt
echo "$dir/acct-list.txt updated."
fi
rm /tmp/acct-list.txt
)
done
fi
#
# create the various index.html files.
#
for dir in $(find . -type d -print); do
if [ "$dir" = '.' ]; then
baseURL="https://cashoptimizer.pages.dev"
ofile="index.html"
else
baseURL="https://cashoptimizer.pages.dev$(echo $dir | sed 's/^\.//')"
ofile="$dir/index.html"
fi
tree "$dir" \
-o "$ofile" \
-H "$baseURL" \
-L 1 \
--noreport \
--dirsfirst \
--charset utf-8 \
--ignore-case \
--timefmt "%b %d %Y %H:%M" \
-h -D \
--hintro "../src/hintro.html" \
-I "index.html" \
-P "*.json|*.csv|*.html|*.txt"
done