diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2014-12-22 21:56:09 +0100 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2014-12-22 21:56:09 +0100 |
commit | 8e26e6e963434108d418557cd48cf6604de30c0d (patch) | |
tree | 905b300b05ad06d49d35848b4e2594a4630307c4 | |
parent | 676e9dd82ef7e2dfb61a3eea0be36bc997def02a (diff) | |
download | vim-polyglot-8e26e6e963434108d418557cd48cf6604de30c0d.tar.gz vim-polyglot-8e26e6e963434108d418557cd48cf6604de30c0d.zip |
Allow selecting subtree of git repository
-rwxr-xr-x | build | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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 |