#!/usr/bin/env bash # ╭──────────────────────────────────────────────────────────╮ # │ Interactivie Issue management of forgejo │ # ╰──────────────────────────────────────────────────────────╯ host="git.alecodes.page" repo="$(git remote get-url origin | rev | cut -d '/' -f -2 | rev | cut -d '.' -f 1)" cache="$(mktemp --directory)" # --preview "[[ -e $cache/{1}.md ]] && bat $cache/{1}.md || fj --host $host issue view \"${repo}$(echo {1} | tr -d ':')\" | tee $cache/{1}.md" \ # TODO: Add more keybindings to interact with issues fj --host "$host" issue search --repo "$repo" | tail -n +2 | fzf \ --preview "id=\"$(echo "{1}" | tr -cd "[:digit:]")\"; [[ -e $cache/$id ]] && bat $cache/$id || fj --host $host issue view ${repo}#$id | tee $cache/$id" \ --bind "ctrl-r:execute-silent(rm -f $cache/{1})+refresh-preview" \ --bind "ctrl-o:execute-silent(tea open {1})" rm -rf "$cache"