scripts: add count-source-lines

This commit is contained in:
thislight 2024-11-19 21:12:28 +08:00
parent e174b7aafd
commit 9e9a831785
No known key found for this signature in database
GPG key ID: FCFE5192241CCD4E
2 changed files with 12 additions and 1 deletions

View file

@ -8,7 +8,8 @@
"scripts": {
"dev": "vite --host 0.0.0.0",
"preview": "vite preview",
"dist": "vite build"
"dist": "vite build",
"count-source-lines": "exec scripts/src-lc.sh"
},
"keywords": [],
"author": "Rubicon",

10
scripts/src-lc.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
# Count the source lines.
find . '(' ! -path "./node_modules/**" ')' \
-and '(' ! -path "./.git/**" ')' \
-and '(' ! -path "./*dist/**" ')' \
-and '(' ! -path "./bun.lockb" ')' \
-and '(' ! -path "./docs/**" ')' \
-type f -print0 \
| wc -l --files0-from=-