1
0
Fork 0
mirror of synced 2024-11-18 07:25:35 -05:00
tpm/scripts/helpers/utility.sh

33 lines
771 B
Bash
Raw Normal View History

2015-08-03 11:40:50 -04:00
ensure_tpm_path_exists() {
mkdir -p "$(tpm_path)"
}
fail_helper() {
local message="$1"
echo "$message" >&2
FAIL="true"
}
exit_value_helper() {
if [ "$FAIL" == "true" ]; then
exit 1
else
exit 0
fi
}
2022-04-14 19:41:08 -04:00
set_long_tmux_display_time() {
#
# Since tmux display is used to indicate progress, save original
# display-time and temporarily set it to 2 minutes.
# New messages will overwrite previous, so this is not blocking anything.
# It is just a random long time to ensure that the messages don't time-out.
#
# Use this to restore the original display-time before exiting:
#
# tmux set-option -g display-time "$org_display_time"
#
org_display_time="$(tmux show-options -g display-time | awk '{print $2}')"
tmux set-option -g display-time 120000
}