Drop empty link sources; make install refuse them
Five directories swept in held no files — matplotlib, three gtk dirs and one mpv. Git cannot represent an empty directory, so they existed on mainframe where they were created but vanished on clone, and system76's install failed with "Nonexistent target". install now checks every link source exists before running dotbot, so this surfaces on the machine that introduced it rather than the next one to pull.
This commit is contained in:
1 parent
29bcf615e6
commit
1f906acd80
5 files changed
+9
-5
No files matched your search
@@ -20,6 +20,15 @@ if [[ ! -f "${HOSTCONF}" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Git cannot represent an empty directory, so a link whose source contains no
|
||||
# files disappears on clone and dotbot fails with "Nonexistent target". Catch
|
||||
# it here rather than on someone else's machine.
|
||||
missing=0
|
||||
while read -r src; do
|
||||
[[ -e "${src}" ]] || { echo "install: link source missing from the repo: ${src}" >&2; missing=1; }
|
||||
done < <(grep -hoE '^\s+~[^:]*:\s+\S+' meta/base.conf.yaml "${HOSTCONF}" | awk '{print $NF}')
|
||||
(( missing )) && { echo "install: refusing to run with missing sources." >&2; exit 1; }
|
||||
|
||||
git submodule update --init --recursive "${DOTBOT_DIR}"
|
||||
|
||||
echo "==> base"
|
||||
|
||||
@@ -28,4 +28,3 @@
|
||||
~/.config/lazygit: common/lazygit
|
||||
~/.config/ncmpcpp: common/ncmpcpp
|
||||
~/.config/neofetch: common/neofetch
|
||||
~/.config/matplotlib: common/matplotlib
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
- link:
|
||||
~/.config/bob: hosts/mainframe/config/bob
|
||||
~/.config/gtk-3.0: hosts/mainframe/config/gtk-3.0
|
||||
~/.config/inbox-tidy: hosts/mainframe/config/inbox-tidy
|
||||
~/.config/llmfit: hosts/mainframe/config/llmfit
|
||||
~/.config/mimeapps.list: hosts/mainframe/config/mimeapps.list
|
||||
|
||||
@@ -15,9 +15,7 @@
|
||||
~/.config/gh: hosts/sctfw004/config/gh
|
||||
~/.config/gtk-2.0: hosts/sctfw004/config/gtk-2.0
|
||||
~/.config/gtk-3.0: hosts/sctfw004/config/gtk-3.0
|
||||
~/.config/gtk-4.0: hosts/sctfw004/config/gtk-4.0
|
||||
~/.config/mimeapps.list: hosts/sctfw004/config/mimeapps.list
|
||||
~/.config/mpv: hosts/sctfw004/config/mpv
|
||||
~/.config/pavucontrol.ini: hosts/sctfw004/config/pavucontrol.ini
|
||||
~/.config/swayimg: hosts/sctfw004/config/swayimg
|
||||
~/.config/swaync: hosts/sctfw004/config/swaync
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
~/.config/glow: hosts/system76/config/glow
|
||||
~/.config/gtk-2.0: hosts/system76/config/gtk-2.0
|
||||
~/.config/gtk-3.0: hosts/system76/config/gtk-3.0
|
||||
~/.config/gtk-4.0: hosts/system76/config/gtk-4.0
|
||||
~/.config/mimeapps.list: hosts/system76/config/mimeapps.list
|
||||
~/.config/mpd: hosts/system76/config/mpd
|
||||
~/.config/mpv: hosts/system76/config/mpv
|
||||
|
||||
Reference in new issue
Block a user