commit d58c22ff1e755a1ca75b9a0430c3d59700f94692 equwal <13551856+equwal@users.noreply.github.com> 2026-10-04 23:43:21 -0700 bm: create the usertags directory when BOOKMARKS lives elsewhere
bm | 1 + test/run.sh | 9 +++++++++ 2 files changed, 10 insertions(+)
diff --git a/bm b/bm index 5b5f090..6721a7d 100755 --- a/bm +++ b/bm @@ -658,6 +658,7 @@ if [ "$action" = help ]; then fi mkdir -p "$(dirname "$BOOKMARKS")" || die "cannot create directory for $BOOKMARKS" +mkdir -p "$(dirname "$USERTAGS")" [ -e "$BOOKMARKS" ] || : > "$BOOKMARKS" || die "cannot create $BOOKMARKS" if awk '!/\t/ && !/^#/ && NF { found = 1; exit } END { exit !found }' "$BOOKMARKS" diff --git a/test/run.sh b/test/run.sh index 5a5dd34..e40c103 100755 --- a/test/run.sh +++ b/test/run.sh @@ -1330,5 +1330,14 @@ esac eq 'default bookmark file is created under XDG_DATA_HOME' \ "$([ -f "$work/xdg/sbm/bookmarks" ] && echo yes)" 'yes' +( + unset USERTAGS + XDG_DATA_HOME="$work/xdg2" + BOOKMARKS="$work/elsewhere/bookmarks" + printf 'https://tagged.example\tTagged\tnewtag\n' | $BM -m >/dev/null 2>&1 +) +eq 'merge creates the usertags directory when BOOKMARKS lives elsewhere' \ + "$(cat "$work/xdg2/sbm/usertags" 2>/dev/null)" 'newtag | ' + printf '\n%d passed, %d failed\n' "$pass" "$fail" [ "$fail" -eq 0 ]