diff --git a/README.md b/README.md index 9732f0b..d49eea8 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Fast, CLI world clock that displays time zone information using [tz database] to read valid [tz entries]. ```console -$ twc -h -f tz-small.conf +$ twc -h -f tools/samples/tz-small.conf America/New York 2023-12-10 16:39:43 -0500 America/Los Angeles 2023-12-10 13:39:43 -0800 UTC 2023-12-10 21:39:43 +0000 diff --git a/tools/bench-date.sh b/tools/bench-date.sh new file mode 100644 index 0000000..ba0f440 --- /dev/null +++ b/tools/bench-date.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +sed '/^\s*#/d' tools/samples.tz | +while IFS= read -r l +do + TZ=$l date +done diff --git a/tools/package.sh b/tools/package.sh new file mode 100755 index 0000000..ce7a05c --- /dev/null +++ b/tools/package.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +version=1.1.0 +export CFLAGS=-O2 + +clang -arch arm64 -o twc twc.c +tar -czvf twc-$version-arm64-apple-darwin.tar.gz twc + +clang -arch x86_64 -o twc twc.c +tar -czvf twc-$version-x86_64-apple-darwin.tar.gz twc + +docker build -t twc . +docker run --name dist twc +docker cp dist:/app/twc . +docker stop dist +docker rm dist +tar -czvf twc-$version-arm64-linux-debian.tar.gz twc + +# docker run --name dist --rm twc diff --git a/tz-small.conf b/tools/samples/tz-small.conf similarity index 100% rename from tz-small.conf rename to tools/samples/tz-small.conf diff --git a/tz.conf b/tools/samples/tz.conf similarity index 100% rename from tz.conf rename to tools/samples/tz.conf