fix/doc: Refactoring the deploy script to actually be parameterized

instead of writing out each case of config file and location.

Adding some sections in the README about deployment and additions to the
setup.
This commit is contained in:
Finch 2025-07-30 22:12:08 -05:00
parent 96063079b4
commit 6d15be0a5c
2 changed files with 45 additions and 42 deletions

View File

@ -8,7 +8,25 @@ Included are configs for:
- wezterm - wezterm
- zsh - zsh
While the setup is opinionated its goal is to provide desired behaviour rather than limiting to specific ## Deployment
> [!WARNING]
> This script _WILL_ clobber existing configuration files for the above applications. Read the script and backup files before running if needed.
Just run `./deploy.sh`
Configurations will be deployed to standard locations for a *nix/Mac user directory by force creating a symlink back to this repository's files.
### Additions
Configurations and their destinations are listed in the deploy script's associative array (dict) named `configs`. Additions or alterations to locations or new configs are to be added there.
> [!NOTE]
> The wezterm's local configuration file is not currently activated in the `configs` dict. It is meant as a local configuration file and is set up to handle some linux specific configuration settings that may not be applicable. Add this alongside the `wezterm.lua` config (uncommenting in the deploy script) and it will be automatically loaded by the main `wezterm.lua` config.
## Updating
`git pull` will give the latest changes and via symlinks they will immediately be available to the appropriate applications.
## Applications ## Applications
### Neovim ### Neovim

View File

@ -1,46 +1,31 @@
#Zsh #!/usr/bin/env bash
if [ ! -L $HOME/.zshrc ]
then
ln -fs $PWD/zshrc $HOME/.zshrc
fi
if [ ! -L $HOME/.oh-my-zsh/custom/themes ] # Deployment script for dotfiles
then #
ln -fs $PWD/fb-custom.zsh-theme $HOME/.oh-my-zsh/custom/themes/fb-custom.zsh-theme # WARNING: This script _will_ clobber existing files by force linking
fi
# Neovim declare -A configs=(
mkdir -p $HOME/.config/nvim ["zshrc"]="$HOME/.zshrc"
if [ ! -L $HOME/.config/nvim/init.lua ] ["fb-custom.zsh-theme"]="$HOME/.oh-my-zsh/custom/themes"
then ["nvim/init.lua"]="$HOME/.config/nvim/init.lua"
ln -fs $PWD/nvim/init.lua $HOME/.config/nvim/init.lua ["nvim/lua"]="$HOME/.config/nvim/lua"
fi ["nvim/snippets"]="$HOME/.config/nvim/snippets"
["tmux.conf"]="$HOME/.tmux.conf"
["wezterm.lua"]="$HOME/.config/wezterm/wezterm.lua"
# ["wezterm.local_linux.lua"]="$HOME/.config/wezterm/local.lua"
["npmrc"]="$HOME/.npmrc"
)
if [ ! -L $HOME/.config/nvim/lua ] declare -a config_directories=(
then "$HOME/.config/nvim"
ln -fs $PWD/nvim/lua $HOME/.config/nvim/lua "$HOME/.config/wezterm"
fi )
if [ ! -L $HOME/.config/nvim/snippets ] for dir in ${config_directories[@]}; do
then mkdir -p ${dir}
ln -fs $PWD/nvim/snippets $HOME/.config/nvim/snippets done
fi
# Tmux for dotfile in "${!configs[@]}"; do
if [ ! -L $HOME/.tmux.conf ] echo "Deploying $PWD/${dotfile} to ${configs[$dotfile]}"
then ln -fs "$PWD/${dotfile}" "${configs[$dotfile]}"
ln -fs $PWD/tmux.conf $HOME/.tmux.conf done
fi
# Wezterm terminal emulator
if [ ! -L $HOME/.config/wezterm/wezterm.lua ]
then
mkdir -p $HOME/.config/wezterm
ln -fs $PWD/wezterm.lua $HOME/.config/wezterm/wezterm.lua
fi
# Nodejs
if [ ! -L $HOME/.npmrc ]
then
ln -fs $PWD/npmrc $HOME/.npmrc
fi