1
0
Fork 0

nvim: Update plugin updater

This commit is contained in:
Daniel Kempkens 2022-04-27 22:17:14 +02:00
parent 25536230b9
commit 41fee1c941

View file

@ -24,6 +24,7 @@ for plugin in "${plugin_array[@]}"; do
raw_src="$(echo "$plugin" | dasel -r json --plain '.src')" raw_src="$(echo "$plugin" | dasel -r json --plain '.src')"
owner="$(echo "$raw_src" | awk -F'/' '{ print $(NF-1) }')" owner="$(echo "$raw_src" | awk -F'/' '{ print $(NF-1) }')"
repo="$(echo "$raw_src" | awk -F'/' '{ print $(NF) }')" repo="$(echo "$raw_src" | awk -F'/' '{ print $(NF) }')"
name="$(echo "$repo" | tr [.] '-')"
echo "Updating ${owner}/${repo} ..." echo "Updating ${owner}/${repo} ..."
@ -33,18 +34,16 @@ for plugin in "${plugin_array[@]}"; do
clone_src="https://github.com/${owner}/${repo}.git" clone_src="https://github.com/${owner}/${repo}.git"
fi fi
branch="$(echo "$plugin" | jq -r '.branch // empty')"
name="$(echo "$repo" | tr [.] '-')"
fetch_submodules="$(echo "$plugin" | jq -r '.fetchSubmodules // empty')"
nix_prefetch_flags="--quiet" nix_prefetch_flags="--quiet"
fetch_submodules="$(echo "$plugin" | jq -r '.fetchSubmodules // empty')"
if [ "$fetch_submodules" == "true" ]; then if [ "$fetch_submodules" == "true" ]; then
nix_prefetch_flags+=" --fetch-submodules" nix_prefetch_flags+=" --fetch-submodules"
fi fi
if [ -n "$branch" ]; then rev="$(echo "$plugin" | jq -r '.rev // empty')"
nix_prefetch_flags+=" --rev $branch" if [ -n "$rev" ]; then
nix_prefetch_flags+=" --rev $rev"
fi fi
src_json="$(nix-prefetch-git $nix_prefetch_flags "$clone_src")" src_json="$(nix-prefetch-git $nix_prefetch_flags "$clone_src")"