summaryrefslogtreecommitdiffstats
path: root/bin/make-relative-to
blob: 9d947e175ba11dcab88e8f57d25d5cae831b981a (plain)
1
2
3
4
5
6
#! /bin/sh
# make-relative-to : lines path |> directory -> lines path
# Non-matching paths won't get altered.
set -euf

sed "s:^$(echo "$1/" | bre-escape | sed 's/:/\\:/g')::"