manager/files/bash/bashrc.d/lf
Dan Anglin 903e5d8b66
checkpoint: manage home directories
- ensure configured home directories are present and their mode set to
  0700
- move dotfiles to files
- added JSON config
2024-09-09 18:02:53 +01:00

18 lines
352 B
Bash

#!/bin/bash
lf () {
tmp="$(mktemp)"
logpath="${LOG_HOME}/lf.log"
command lf --last-dir-path="$tmp" --log="$logpath" "$@"
if [ -f "$tmp" ]; then
dir="$(cat "$tmp")"
rm -f "$tmp"
if [ -d "$dir" ]; then
if [ "$dir" != "$(pwd)" ]; then
cd "$dir"
fi
fi
fi
}