Allow selecting subtree of git repository

This commit is contained in:
Adam Stankiewicz 2014-12-22 21:56:09 +01:00
parent 676e9dd82e
commit 8e26e6e963

8
build
View File

@ -23,17 +23,18 @@ extract() {
path="$(printf "$pack" | cut -d ':' -f 2)" path="$(printf "$pack" | cut -d ':' -f 2)"
dir="tmp/$(printf "$path" | cut -d '/' -f 2)" dir="tmp/$(printf "$path" | cut -d '/' -f 2)"
directories="DIRS$(printf "$pack" | cut -d ':' -f 3)" directories="DIRS$(printf "$pack" | cut -d ':' -f 3)"
subtree="$(printf "$pack" | cut -d ':' -f 4)"
printf -- "- [$name](https://github.com/$path) (" printf -- "- [$name](https://github.com/$path) ("
subdirs="" subdirs=""
for subdir in ${!directories}; do for subdir in ${!directories}; do
if [ -d "$dir/$subdir" ]; then if [ -d "${dir}${subtree:-/}${subdir}" ]; then
base="$(basename "$subdir")" base="$(basename "$subdir")"
if [[ "$subdirs" != *"$base"* ]]; then if [[ "$subdirs" != *"$base"* ]]; then
subdirs="$subdirs, $base" subdirs="$subdirs, $base"
fi fi
copy_dir "$dir" "$subdir" copy_dir "${dir}${subtree}" "$subdir"
fi fi
done done
@ -45,8 +46,9 @@ extract() {
name="$(printf "$pack" | cut -d ':' -f 1)" name="$(printf "$pack" | cut -d ':' -f 1)"
path="$(printf "$pack" | cut -d ':' -f 2)" path="$(printf "$pack" | cut -d ':' -f 2)"
dir="tmp/$(printf "$path" | 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" printf "Possible error (plugin directory exists): $path\n"
fi fi
done done