From dc91b856a83a9401741847a93d48b37f1ea05867 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 23 Oct 2016 23:28:20 +0200 Subject: file: support exclude patterns --- README | 1 + lib/populate.jq | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README b/README index b1573aa..6aeca5e 100644 --- a/README +++ b/README @@ -20,6 +20,7 @@ Next we'll run populate with a source specification: "mystuff": { "type": "file", "file": { + "exclude": [ ".git" "TODO*" ], "path": "/path/to/mystuff-1.0" } }, diff --git a/lib/populate.jq b/lib/populate.jq index e7e02d3..c51e44e 100644 --- a/lib/populate.jq +++ b/lib/populate.jq @@ -90,6 +90,8 @@ def rsync_script: @sh " -vFrlptD \\", @sh " --delete-excluded \\", @sh " -f \("P /*", ($rsync_sources[] | "R /\(.key)")) \\", + ($file_sources[] | .key as $key | .value.file.exclude | select(. != null)[] | + @sh " -f \("- /\($key)/\(.)") \\"), @sh " \"$srcdir\"/ \\", (if $is_local then @sh " \($target.path)" -- cgit v1.2.3