From eb18999ad2199bbe36081424965dd176573e4213 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Mon, 22 Jan 2024 13:42:08 -0400 Subject: [PATCH] Let projects specify a default mask file for themselves Signed-off-by: Juan Cruz Viotti --- README.markdown | 4 ++++ pull | 8 ++++++++ vendorpull.mask | 3 +++ 3 files changed, 15 insertions(+) create mode 100644 vendorpull.mask diff --git a/README.markdown b/README.markdown index c548bde..a17555d 100644 --- a/README.markdown +++ b/README.markdown @@ -124,6 +124,10 @@ contains an 8.1M `docs` directory. We can ignore this directory by creating a docs ``` +If you do not provide a `.mask` file on the project consuming the dependency, +vendorpull will look for a *default* mask file called `vendorpull.mask` at the +top level of the project you are vendoring. + Patches ------- diff --git a/pull b/pull index 9d8b391..695531d 100755 --- a/pull +++ b/pull @@ -58,6 +58,14 @@ vendor() { log "Masking $1: $path" rm -rf "$4/$1/${path:?}" done < "$VENDOR/$1.mask" + elif [ -f "$4/$1/vendorpull.mask" ] + then + while read -r path + do + log "Masking $1: $path" + rm -rf "$4/$1/${path:?}" + done < "$4/$1/vendorpull.mask" + rm -f "$4/$1/vendorpull.mask" fi # Swap diff --git a/vendorpull.mask b/vendorpull.mask new file mode 100644 index 0000000..1c69b5a --- /dev/null +++ b/vendorpull.mask @@ -0,0 +1,3 @@ +bootstrap +.editorconfig +README.markdown