mirror of
https://github.com/jbranchaud/til
synced 2026-07-06 01:00:35 +00:00
Add two new browsing tasks for popping open latest TIL in browser
This commit is contained in:
@@ -11,6 +11,34 @@ tasks:
|
||||
cmds:
|
||||
- task --list
|
||||
|
||||
browse:
|
||||
desc: Pick from 5 most recent TILs (fzf) and open in browser
|
||||
cmds:
|
||||
- |
|
||||
FILE=$(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
|
||||
if [ -n "$FILE" ]; then
|
||||
gh browse "$FILE"
|
||||
fi
|
||||
interactive: true
|
||||
silent: true
|
||||
|
||||
browse:latest:
|
||||
desc: Open the single most recent TIL in the browser
|
||||
cmds:
|
||||
- |
|
||||
FILE=$(git log --diff-filter=A --name-only --pretty=format: -- '*/*.md' \
|
||||
| grep -v '^$' \
|
||||
| awk '!seen[$0]++' \
|
||||
| head -1)
|
||||
if [ -n "$FILE" ]; then
|
||||
gh browse "$FILE"
|
||||
fi
|
||||
silent: true
|
||||
|
||||
notes:
|
||||
desc: Interactive picker for notes tasks
|
||||
cmds:
|
||||
|
||||
Reference in New Issue
Block a user