add zk workflow

fixes #1
This commit is contained in:
Alexander Navarro 2024-09-12 16:55:05 -03:00
parent 595ac566ea
commit 8b85cf7c9e
Signed by untrusted user who does not match committer: anavarro
GPG key ID: 6426043E9FA3E3B5
12 changed files with 373 additions and 47 deletions

20
scripts/fzf-fj Executable file
View file

@ -0,0 +1,20 @@
#!/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"