-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtree.sh
More file actions
executable file
·28 lines (23 loc) · 823 Bytes
/
Copy pathtree.sh
File metadata and controls
executable file
·28 lines (23 loc) · 823 Bytes
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
echo "Root" > tree.txt
tree -I 'node_modules|dist|vscode-icons|locales' >> tree.txt
echo "" >> tree.txt
echo "=================================" >> tree.txt
echo "" >> tree.txt
echo "src/*.ts, *.tsx の統計:" >> tree.txt
files=$(find src/ -type f \( -name "*.ts" -o -name "*.tsx" \))
total_lines=0
total_chars=0
total_bytes=0
for f in $files; do
lines=$(wc -l < "$f")
chars=$(wc -m < "$f")
bytes=$(wc -c < "$f")
total_lines=$((total_lines + lines))
total_chars=$((total_chars + chars))
total_bytes=$((total_bytes + bytes))
done
echo "合計行数: $total_lines" >> tree.txt
echo "合計文字数: $total_chars" >> tree.txt
echo "合計ファイルサイズ(bytes): $total_bytes" >> tree.txt
echo "" >> tree.txt
echo "開発時のdev container全体のサイズ(bytes): $(du -sh)" >> tree.txt