1
0
mirror of https://github.com/RyanGreenup/cadmus.git synced 2025-07-31 19:30:12 +02:00

[FIX] List BackLinks now takes STDIN/STDOUT #1

This means that the xclip used will be governed by cadmus making it more
cross platform
This commit is contained in:
ryangreenup
2020-07-24 01:21:20 +10:00
parent b515f47ae8
commit 6905388d27
2 changed files with 2 additions and 2 deletions

View File

@@ -297,7 +297,7 @@ CadmusTools () {
;;
webtitle) shift; "${script_dir}/tools/PrintWebTitle.sh" "$(CLIP_OUT)" | CLIP_IN
;;
backlinks) shift; "${script_dir}/tools/List-Backlinks.sh" "${NOTES_DIR}" ${@:-} && exit 0
backlinks) shift; "${script_dir}/tools/List-Backlinks.sh" "$(CLIP_OUT)" ${@:-} && exit 0
;;
link) shift; "${script_dir}/tools/LinkMarkdownNotes.sh" "${NOTES_DIR}" "$(CLIP_OUT)" | CLIP_IN && exit 0
;;

View File

@@ -6,8 +6,8 @@ command -v sd >/dev/null 2>&1 || { echo >&2 "I require sd (sed replacement) but
command -v xclip >/dev/null 2>&1 || { echo >&2 "I require xclip but it's not installed. Aborting."; exit 1; }
term=$(basename "${1}" | cut -f 1 -d '.')
term=$(xclip -selection clipboard -o | xargs basename | cut -f 1 -d '.')
rg -e "\[.*\]\(.*$term\.md\)" -e "\[\[$term\]\]" -e "\[\[$term.*\]\]" \
~/Notes/MD/notes \
-t markdown -ol