From 1e39d19ab2e38eb5d8b1ac01506a442a3f53741d Mon Sep 17 00:00:00 2001 From: dissimulo Date: Tue, 21 Apr 2026 08:06:07 -0700 Subject: [PATCH] Ensure Prezto submodule is initialized on clone/install install.sh: use --recurse-submodules on the initial clone, and always run 'git submodule update --init --recursive' before rake install so a fresh checkout doesn't leave zsh/prezto empty. README: document --recurse-submodules for manual clones; mention the recovery command for existing shallow clones. Fixes: bad math expression errors and 'no such file or directory: ~/.zprezto/runcoms/zshrc' on fresh shell startup when the Prezto submodule hadn't been initialized. --- README.md | 13 +++++++++---- install.sh | 8 +++++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 92248513..a4ed4977 100644 --- a/README.md +++ b/README.md @@ -18,10 +18,15 @@ curl -fsSL https://gitea.dlw.la/dissimulo/drunkendotfiles/raw/branch/drunkendotf Or clone first: ```sh -git clone https://gitea.dlw.la/dissimulo/drunkendotfiles.git ~/.yadr +git clone --recurse-submodules https://gitea.dlw.la/dissimulo/drunkendotfiles.git ~/.yadr ~/.yadr/install.sh ``` +`--recurse-submodules` matters: Prezto lives in `zsh/prezto` as a git +submodule. Without it, `~/.zshrc` fails on startup with a missing +`~/.zprezto/runcoms/zshrc`. (If you already cloned without it, +`cd ~/.yadr && git submodule update --init --recursive` catches you up.) + The installer: 1. Clones this repo to `~/.yadr` @@ -38,12 +43,12 @@ Two things can be refreshed independently. ### Pull new drunkendotfiles changes ```sh -cd ~/.yadr && git pull +cd ~/.yadr && git pull --recurse-submodules ``` That gets you any new config changes, tmux tweaks, helper scripts, etc. -pushed to this repo. Vim plugins and prezto modules are *not* touched — see -below. +pushed to this repo, plus any bumps to the Prezto submodule pointer. +Vim plugins are *not* touched — see below. ### Refresh YADR plugins diff --git a/install.sh b/install.sh index 869aaeba..55f924eb 100755 --- a/install.sh +++ b/install.sh @@ -62,11 +62,17 @@ elif [ -d "$YADR_DIR" ]; then exit 1 else log "Cloning drunkendotfiles" - git clone --depth=1 "$REPO_URL" "$YADR_DIR" + git clone --recurse-submodules "$REPO_URL" "$YADR_DIR" fi cd "$YADR_DIR" +# 1a. Ensure submodules are initialized (Prezto lives in zsh/prezto as a +# submodule — without it, ~/.zshrc fails with "no such file or directory: +# ~/.zprezto/runcoms/zshrc"). Safe to run on fresh and existing clones alike. +log "Ensuring submodules are initialized" +git submodule update --init --recursive + # 2. Run YADR's native install (Vim plugins, prezto, etc.) if have rake; then log "Running YADR rake install"