diff --git a/.gitignore b/.gitignore index 4397dfb..0f04579 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.swp pull.log -update.tbl \ No newline at end of file +update.tbl +dotfiles.git \ No newline at end of file diff --git a/modules/dotfiles.zsh b/modules/dotfiles.zsh new file mode 100644 index 0000000..e65c98d --- /dev/null +++ b/modules/dotfiles.zsh @@ -0,0 +1,21 @@ +if [[ $_zeesh_fresh_install -eq 1 ]]; then + ticker_finish + + if [[ -v ZEESH_DOTFILES_DIR ]]; then + if read -q "ZEESH_DOTFILES?Configure dotfile management? [yn] "; then + read "ZEESH_DOTFILES_INPUT?Location of dotfile repo? [~/.local/share/zeesh/dotfiles.git] " + export ZEESH_DOTFILES_DIR="${ZEESH_DOTFILES_INPUT:-${HOME}/.local/share/zeesh/dotfiles.git}" + echo "ZEESH_DOTFILES_DIR=${ZEESH_DOTFILES_DIR}" >> $HOME/.zshrc.preload + fi + fi +fi + +if [[ -v ZEESH_DOTFILES_DIR ]]; then + if [[ ! -d $ZEESH_DOTFILES_DIR ]]; then + ticker_message "initializing dotfiles repository" + git init --bare --quiet $ZEESH_DOTFILES_DIR + git --git-dir=$ZEESH_DOTFILES_DIR config status.showUntrackedFiles no + fi + + alias dotfiles='git --git-dir="$ZEESH_DOTFILES_DIR" --work-tree="$HOME"' +fi \ No newline at end of file