stockholm/bin/make-rsync-whitelist
2015-05-21 01:56:08 +02:00

16 lines
270 B
Bash
Executable File

#! /bin/sh
# make-rsync-whitelist : lines relpath |> liens rsync-filter
set -euf
set -- "$(cat)"
# include all files in stdin and their directories
{
echo "$1"
echo "$1" | make-parent-dirs | sort | uniq
} \
| sed 's|^|+ /|'
# exclude everything else
echo '- *'