#!/usr/bin/env bash

pushd ~/ > /dev/null || exit 1

AUTOJUMP_TXT="$HOME/.local/share/autojump/autojump.txt"
mkdir -p "$(dirname "$AUTOJUMP_TXT")"
touch "$AUTOJUMP_TXT"

mr checkout > /dev/null

mkdir -p ~/.emacs.d/.cache/
(mr inject2 3>&2 2>&1 1>&3) 2>/dev/null | \
  sed -E 's/\/home\/andreh/~/'          | \
  awk '{print "\""$1"/""\""}'           | \
  cat <(printf "(\\n") - <(printf ")") > ~/.emacs.d/.cache/projectile-bookmarks.eld

popd > /dev/null || exit 1
