aboutsummaryrefslogtreecommitdiff
path: root/.config/yadm/lib/bootstrap
blob: e367320fa8c96bc72fda2f0d239325e81d5167e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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"
}