feat: strip-home fn

This commit is contained in:
2024-06-17 13:10:01 +03:00
parent 8e9d3e1182
commit 57c727c25c

View File

@@ -451,7 +451,18 @@ disable_touchid_sudo() {
popd
}
strip-home() {
repl="~"
if [[ "$1" == "-e" ]]; then
repl=""
shift
fi
dir="$1"
echo ${dir/$HOME/$repl}
}
# select random element from arguments
# always keep last, breaks syntax highlighting
randarg() {
echo "${${@}[$RANDOM % $# + 1]}"
}