os

An operating system
git clone https://erai.gay/code/os/
Log | Files | Refs | README | LICENSE

commit 5bf8ba671da36de6e837384bf20b59ad0511eca6
parent 5ddcd61e944b7764c9717e508a63de16518767d7
Author: erai <erai@omiltem.net>
Date:   Fri, 31 Jan 2025 17:33:13 +0000

add cloc

Diffstat:
M.build.yml | 1+
Acloc.sh | 23+++++++++++++++++++++++
2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/.build.yml b/.build.yml @@ -6,6 +6,7 @@ sources: tasks: - bootstrap: "cd os && ./bootstrap.sh" - build: "cd os && ./build.sh" + - cloc: "cd os && ./cloc.sh" triggers: - action: email condition: always diff --git a/cloc.sh b/cloc.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +data="$( + for name in *.om *.peg; do + case "${name}" in + "parse3.om") + continue + ;; + "parsepeg.om") + continue + ;; + *) + ;; + esac + count=$(sed '/^[ \t]*\(\/\/.*\)\?$/d' "${name}" | wc -l) + printf '%06s %s\n' "${count}" "${name}" + done +)" + +printf '%s\n' "${data}" | sort -n +printf '\n' +total=$(printf '%s\n' "${data}" | awk '{sum+=$1}END{print sum}') +printf '%06s %s\n' "${total}" "total"