From 8e26e6e963434108d418557cd48cf6604de30c0d Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Mon, 22 Dec 2014 21:56:09 +0100 Subject: Allow selecting subtree of git repository --- build | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'build') diff --git a/build b/build index 26e83fae..fe501c6c 100755 --- a/build +++ b/build @@ -23,17 +23,18 @@ extract() { path="$(printf "$pack" | cut -d ':' -f 2)" dir="tmp/$(printf "$path" | cut -d '/' -f 2)" directories="DIRS$(printf "$pack" | cut -d ':' -f 3)" + subtree="$(printf "$pack" | cut -d ':' -f 4)" printf -- "- [$name](https://github.com/$path) (" subdirs="" for subdir in ${!directories}; do - if [ -d "$dir/$subdir" ]; then + if [ -d "${dir}${subtree:-/}${subdir}" ]; then base="$(basename "$subdir")" if [[ "$subdirs" != *"$base"* ]]; then subdirs="$subdirs, $base" fi - copy_dir "$dir" "$subdir" + copy_dir "${dir}${subtree}" "$subdir" fi done @@ -45,8 +46,9 @@ extract() { name="$(printf "$pack" | cut -d ':' -f 1)" path="$(printf "$pack" | cut -d ':' -f 2)" dir="tmp/$(printf "$path" | cut -d '/' -f 2)" + subtree="$(printf "$pack" | cut -d ':' -f 4)" - if [ -d "$dir/plugin" ]; then + if [ -d "$dir${subtree:-/}plugin" ]; then printf "Possible error (plugin directory exists): $path\n" fi done -- cgit v1.2.3