bootstrap: link first, then run install/update scripts

This commit is contained in:
Henrik Lissner 2016-12-25 19:08:21 -05:00
parent 061c25f4fc
commit 284deecd2c

View file

@ -105,19 +105,8 @@ for topic in ${@:-$(find "$ENABLED_DIR" -maxdepth 1 -type l)}; do
[[ "$link" && -x "$bin" ]] && _link "$bin" "$HOME/.bin/"
done
# Link topic to .enabled.d
if [[ -h "$ENABLED_DIR/$tname" ]]; then
[[ "$update" && -x $tpath/update ]] && _run "$tpath/update"
else
# Register topic as 'enabled'
_run ln -svf "$tpath" "$ENABLED_DIR/$tname"
# Run install script
[[ "$install" && -x $tpath/install ]] && _run "$tpath/install"
fi
# Symlink dotfiles from topic directories (2 levels deep)
[[ "$link" ]] || continue
if [[ $link ]]; then
for file in "$tpath"/.[a-zA-Z]*; do
if [[ -d $file && "${file##*/}" == .config ]]; then
for subfile in "$file"/*; do
@ -129,6 +118,18 @@ for topic in ${@:-$(find "$ENABLED_DIR" -maxdepth 1 -type l)}; do
_link "$file" "$HOME/"
fi
done
fi
# Link topic to .enabled.d
if [[ -h "$ENABLED_DIR/$tname" ]]; then
[[ "$update" && -x $tpath/update ]] && _run "$tpath/update"
else
# Register topic as 'enabled'
_run ln -svf "$tpath" "$ENABLED_DIR/$tname"
# Run install script
[[ "$install" && -x $tpath/install ]] && _run "$tpath/install"
fi
done
# vim:set ft=sh: