X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=brc;h=02ad1a67b78073f1cb58f6bac878d3e64def4582;hb=5abdcfce00c6ff61bf3856f7b5101915dc096107;hp=138fd896b26df6b2ae9361ba75709abd9855fe93;hpb=103a2e153f844343c359882079936b2521c82f15;p=distro-setup diff --git a/brc b/brc index 138fd89..02ad1a6 100644 --- a/brc +++ b/brc @@ -2183,6 +2183,23 @@ s/^\Wcapability: (.*)/\1/;Ta;h;b "|sort -r } +# Run script by copying it to a temporary location first, +# and changing directory, so we don't have any open +# directories or files that could cause problems when +# remounting. +z() { + local tmp + tmp=$(type -p "$1") + if [[ $tmp ]]; then + cd $(mktemp -d) + cp -a "$tmp" . + shift + ./"${tmp##*/}" "$@" + else + "$@" + fi +} + # * misc stuff