berth updates
This commit is contained in:
@@ -145,3 +145,16 @@ service_upstream() {
|
||||
*) printf '%s' "$up" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# A .gitignore pattern containing a slash anchors to its own directory, so the
|
||||
# only way to know a path is ignored is to ask git. Used before writing key
|
||||
# material (vpn.sh) and machine snapshots (host.sh) — refuse, don't hope.
|
||||
assert_ignored() {
|
||||
local path="$1"
|
||||
if ! git check-ignore -q "$path" 2>/dev/null; then
|
||||
echo "REFUSING: '$path' is not gitignored." >&2
|
||||
echo " Writing there would stage it on the next 'git add'." >&2
|
||||
echo " Verify with: git check-ignore -v $path" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user