summaryrefslogtreecommitdiff
path: root/actions.sh
diff options
context:
space:
mode:
Diffstat (limited to 'actions.sh')
-rwxr-xr-xactions.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/actions.sh b/actions.sh
new file mode 100755
index 0000000..49fa4e2
--- /dev/null
+++ b/actions.sh
@@ -0,0 +1,40 @@
+#!/usr/bin/env sh
+
+set -euC
+
+test () {
+ eval "prove -l ${1-} t/"
+}
+
+start () {
+ script/jwebmail daemon
+}
+
+logrotate () {
+ mode=${1:-development}
+ mv -i "log/$mode.log" "log/${mode}_$(date --iso-8601=minutes).log"
+}
+
+linelength () {
+ files=${1:-'README.md CHANGES LICENSE'}
+ for file in $files
+ do
+ fold -s -w 85 "$file" | diff "$file" -
+ done
+}
+
+follow () {
+ mode=${1:-development}
+ tail -f "log/$mode.log"
+}
+
+check_manifest () {
+ perl -nE 'chomp; say unless -e' MANIFEST
+}
+
+cmd=$1
+shift
+if [ "$(command -v "$cmd")" = "$cmd" ]
+then eval "$cmd" "$@"
+else echo "unkown commad '$cmd'"; exit 1
+fi