dotfiles/install.sh
2025-04-23 22:03:54 -04:00

43 lines
626 B
Bash
Executable File

#!/bin/sh
#
# Install my dotfiles.
#
STOW=$(which stow || echo -n "")
if [ -z "$STOW" ]; then
STOW="./stow.sh -s"
fi
git submodule update --init --recursive
# if these aren't links, move them out of the way?
for f in ~/.zshrc ~/.profile; do
if [ -f "$f" ]; then
mv "$f" "$f.orig"
fi
done
if [ -n "$1" ]; then
$STOW -t $HOME "$1"
exit 1
fi
# rm -f $HOME/.zshrc $HOME/.profile >/dev/null 2>&1
# install all dotfiles
#find * -maxdepth 0 -type d | xargs -I{} $STOW -t "$HOME" {}
# install general dotfiles
for dir in \
git \
nvim \
sh \
ssh \
tmux \
zsh \
aichat
do
$STOW -t $HOME $dir
done