1
0
mirror of https://github.com/jbranchaud/til synced 2026-07-06 01:00:35 +00:00

Create a shared task to deduplicate logic listing recent TILs

This commit is contained in:
jbranchaud
2026-07-05 18:25:02 -05:00
parent 5f4308c1af
commit d4766dad95
+15 -13
View File
@@ -11,33 +11,35 @@ tasks:
cmds:
- task --list
browse:
desc: Pick from 5 most recent TILs (fzf) and open in browser
browse:list:
desc: Print deduped, newest-first TIL paths
silent: true
cmds:
- |
FILE=$(git log --diff-filter=A --name-only --pretty=format: -- '*/*.md' \
git log --diff-filter=A --name-only --pretty=format: -- '*/*.md' \
| grep -v '^$' \
| awk '!seen[$0]++' \
| head -5 \
| fzf --prompt="Open TIL: " --height=40% --reverse) || true
| awk '!seen[$0]++'
browse:
desc: Pick from 5 most recent TILs (fzf) and open in browser
interactive: true
silent: true
cmds:
- |
FILE=$(task browse:list | head -5 | fzf --prompt="Open TIL: " --height=40% --reverse) || true
if [ -n "$FILE" ]; then
gh browse "$FILE"
fi
interactive: true
silent: true
browse:latest:
desc: Open the single most recent TIL in the browser
silent: true
cmds:
- |
FILE=$(git log --diff-filter=A --name-only --pretty=format: -- '*/*.md' \
| grep -v '^$' \
| awk '!seen[$0]++' \
| head -1)
FILE=$(task browse:list | head -1)
if [ -n "$FILE" ]; then
gh browse "$FILE"
fi
silent: true
notes:
desc: Interactive picker for notes tasks