From 23544e126419753893f48082960796b65e60fc93 Mon Sep 17 00:00:00 2001 From: "Anna (navi) Figueiredo Gomes" Date: Thu, 5 Oct 2023 18:59:35 +0100 Subject: first batch of plugins Signed-off-by: Anna (navi) Figueiredo Gomes --- build.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 build.sh (limited to 'build.sh') diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..c03ee96 --- /dev/null +++ b/build.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +api_key="${1}" +skel="${2}" +plugin="${3}" +name="${4:=${3#*/}}" + +if ! [[ -e ${skel} ]] + || [[ -z ${api_key} ]] + || [[ -z ${plugin} ]]; then + >&2 echo "usage: ${0} " + exit -1 +fi + +echo "generating app-nvim/${name}" + +repo_info=$(curl -L \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${api_key}" \ + https://api.github.com/repos/${plugin} 2>/dev/null) + +src=https://github.com/${plugin} +desc=$(jq -r .description <<< ${repo_info}) +license=$(jq -r .license.spdx_id <<< ${repo_info}) +url=$(jq -r .html_url <<< ${repo_info}) + +mkdir -p app-nvim/${name} +sed -e "s#@DESCRIPTION@#${desc}#" \ + -e "s#@URI@#${url}#" \ + -e "s#@SRC@#${src}#" \ + -e "s#@LICENSE@#${license}#" \ + -e "s#@PLUGIN@#${plugin}#" \ + ${skel} > app-nvim/${name}/${name}-9999.ebuild -- cgit v1.2.3