bootstrap: link first, then run install/update scripts
This commit is contained in:
parent
061c25f4fc
commit
284deecd2c
29
bootstrap
29
bootstrap
|
@ -105,6 +105,21 @@ for topic in ${@:-$(find "$ENABLED_DIR" -maxdepth 1 -type l)}; do
|
||||||
[[ "$link" && -x "$bin" ]] && _link "$bin" "$HOME/.bin/"
|
[[ "$link" && -x "$bin" ]] && _link "$bin" "$HOME/.bin/"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Symlink dotfiles from topic directories (2 levels deep)
|
||||||
|
if [[ $link ]]; then
|
||||||
|
for file in "$tpath"/.[a-zA-Z]*; do
|
||||||
|
if [[ -d $file && "${file##*/}" == .config ]]; then
|
||||||
|
for subfile in "$file"/*; do
|
||||||
|
base="$HOME/${file##*/}/"
|
||||||
|
[[ -d $base ]] || _run mkdir -p "$base"
|
||||||
|
_link "$subfile" "$base"
|
||||||
|
done
|
||||||
|
elif [[ -e $file ]]; then
|
||||||
|
_link "$file" "$HOME/"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# Link topic to .enabled.d
|
# Link topic to .enabled.d
|
||||||
if [[ -h "$ENABLED_DIR/$tname" ]]; then
|
if [[ -h "$ENABLED_DIR/$tname" ]]; then
|
||||||
[[ "$update" && -x $tpath/update ]] && _run "$tpath/update"
|
[[ "$update" && -x $tpath/update ]] && _run "$tpath/update"
|
||||||
|
@ -115,20 +130,6 @@ for topic in ${@:-$(find "$ENABLED_DIR" -maxdepth 1 -type l)}; do
|
||||||
# Run install script
|
# Run install script
|
||||||
[[ "$install" && -x $tpath/install ]] && _run "$tpath/install"
|
[[ "$install" && -x $tpath/install ]] && _run "$tpath/install"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Symlink dotfiles from topic directories (2 levels deep)
|
|
||||||
[[ "$link" ]] || continue
|
|
||||||
for file in "$tpath"/.[a-zA-Z]*; do
|
|
||||||
if [[ -d $file && "${file##*/}" == .config ]]; then
|
|
||||||
for subfile in "$file"/*; do
|
|
||||||
base="$HOME/${file##*/}/"
|
|
||||||
[[ -d $base ]] || _run mkdir -p "$base"
|
|
||||||
_link "$subfile" "$base"
|
|
||||||
done
|
|
||||||
elif [[ -e $file ]]; then
|
|
||||||
_link "$file" "$HOME/"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# vim:set ft=sh:
|
# vim:set ft=sh:
|
||||||
|
|
Loading…
Reference in a new issue