dotfiles/zsh/func/init-env-tilde-paths
Eryn Wells cbebbffee0 [zsh] Establish a DOTFILES_HOME variable
Look for a config file at ~/.config/dotfiles-home that contains the path to the
repo, or check the usual location of ~/.dotfiles.

Do this in a shell function in .zshenv so it's repeatable. This needs to be done
very early in the init process.
2026-01-18 08:05:33 -07:00

22 lines
408 B
Bash

#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
function init-env-tilde-paths
{
for candidate_code_path in \
"$HOME/Code" \
"$HOME/Developer" \
"$HOME/Documents/Code"
do
if [[ ! -d "$candidate_code_path" ]]; then
continue
fi
c="$candidate_code_path"
break
done
export df="$DOTFILES_HOME"
}
init-env-tilde-paths "$@"