parent
595ac566ea
commit
8b85cf7c9e
12 changed files with 373 additions and 47 deletions
20
scripts/fzf-fj
Executable file
20
scripts/fzf-fj
Executable 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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue