2021-10-22 16:24:02 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
new_tmp_dir() {
|
|
|
|
local dirname
|
|
|
|
dirname=$(mktemp -d)
|
|
|
|
mkdir -p "$dirname"
|
|
|
|
cd "$dirname"
|
|
|
|
trap "rm -rf '$dirname'" EXIT
|
|
|
|
}
|
|
|
|
|
2022-10-21 05:13:09 +00:00
|
|
|
run_command() {
|
|
|
|
echo "\$ $@"
|
|
|
|
eval "$@"
|
2021-10-23 16:34:58 +00:00
|
|
|
}
|
2021-10-23 16:22:45 +00:00
|
|
|
|
2022-10-21 05:13:09 +00:00
|
|
|
blank() {
|
|
|
|
echo ""
|
|
|
|
}
|
2021-10-22 16:24:02 +00:00
|
|
|
|
2022-10-21 05:13:09 +00:00
|
|
|
comment() {
|
|
|
|
indented="$(echo "$@"| sed 's/^/# /g')"
|
|
|
|
blank
|
|
|
|
echo -e "\033[0;32m${indented}\033[0m"
|
|
|
|
blank
|
2021-10-22 16:24:02 +00:00
|
|
|
}
|