diff options
Diffstat (limited to 'scripts/common.bash')
-rw-r--r-- | scripts/common.bash | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/scripts/common.bash b/scripts/common.bash index 20bcb04..cfa04c9 100644 --- a/scripts/common.bash +++ b/scripts/common.bash @@ -1,7 +1,23 @@ -#!/bin/env bash +#!/usr/bin/env bash +# shellcheck disable=2120 function _panic() { local message=$1 echo >&2 "$message" exit 1 } + +function _md5() { + local path=$1 + md5sum "$path" | cut -d' ' -f1 +} + +function pushd() { + # shellcheck disable=2119 + command pushd "$@" >/dev/null || _panic +} + +function popd() { + # shellcheck disable=2119 + command popd "$@" >/dev/null || _panic +} |