19 lines
363 B
Bash
Executable file
19 lines
363 B
Bash
Executable file
#!/usr/bin/env sh
|
|
|
|
# https://github.com/soulim/bookmarks.txt/blob/main/bin/bookmarks
|
|
|
|
set -o errexit
|
|
set -o nounset
|
|
|
|
url=${1:-}
|
|
title=${2:-}
|
|
|
|
global="$HOME/Personal/bookmarks.txt"
|
|
|
|
if [ -n "$url" ]; then
|
|
echo "$url $title" >>$global
|
|
else
|
|
local="$PWD/bookmarks.txt"
|
|
|
|
(cat "$global" "$local" 2>/dev/null || true) | fzf | cut -d ' ' -f 1 | xargs open
|
|
fi
|