From 9e9a831785b9a9c7ad1889443255a9240069edf9 Mon Sep 17 00:00:00 2001 From: thislight Date: Tue, 19 Nov 2024 21:12:28 +0800 Subject: [PATCH] scripts: add count-source-lines --- package.json | 3 ++- scripts/src-lc.sh | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 scripts/src-lc.sh diff --git a/package.json b/package.json index 4214584..4d9e37a 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/scripts/src-lc.sh b/scripts/src-lc.sh new file mode 100755 index 0000000..ac5ec04 --- /dev/null +++ b/scripts/src-lc.sh @@ -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=-