aboutsummaryrefslogtreecommitdiff
path: root/.config/yadm/lib
diff options
context:
space:
mode:
Diffstat (limited to '.config/yadm/lib')
-rw-r--r--.config/yadm/lib/bootstrap22
1 files changed, 22 insertions, 0 deletions
diff --git a/.config/yadm/lib/bootstrap b/.config/yadm/lib/bootstrap
new file mode 100644
index 0000000..e367320
--- /dev/null
+++ b/.config/yadm/lib/bootstrap
@@ -0,0 +1,22 @@
+#!/bin/sh
+unset LANG # never use custom locale in TTY/logs
+
+TIMESTART="$(date +%s)"
+
+begintask() {
+ printf '%s ...' "$1"
+}
+endtask() {
+ EXIT_CODE=$?
+ [ $EXIT_CODE -eq 0 ] && echo ' OK' || echo ' ERROR'
+ return $EXIT_CODE
+}
+s() { # s for silent
+ "$@" 1> /dev/null 2> /dev/null
+}
+
+finishtime() {
+ TIMESTOP="$(date +%s)"
+ echo "$(( $TIMESTOP - $TIMESTART ))s"
+}
+