From 1f782ea45f8bfb7fa0270ceef8541ce9abc6488e Mon Sep 17 00:00:00 2001 From: Brent Schroeter Date: Tue, 17 Mar 2026 14:44:43 -0700 Subject: [PATCH] add convenience script for local setup --- local-install.fish | 53 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 local-install.fish diff --git a/local-install.fish b/local-install.fish new file mode 100644 index 0000000..4c81094 --- /dev/null +++ b/local-install.fish @@ -0,0 +1,53 @@ +# Install dotfiles (and optionally tools) to the current macOS host, +# for example when provisioning within a VM. + +set -f DEFAULT_FULL_NAME 'Brent Schroeter' + +argparse -S 'email=' 'full-name=' install-mise overwrite -- $argv + +if not set -ql _flag_full_name + set -f _flag_full_name "$DEFAULT_FULL_NAME" +end +if not set -ql _flag_email + echo '--email is required for VCS configuration' >&2 + return 1 +end + +mkdir -p ~/.config + +if set -ql _flag_overwrite; or not test -e ~/.gitconfig + cp ./assets/git/gitconfig ~/.gitconfig + sed -i '' "s/{{ VCS_EMAIL }}/$_flag_email/" ~/.gitconfig + sed -i '' "s/{{ VCS_NAME }}/$_flag_full_name/" ~/.gitconfig +else + echo 'Git config already exists. Use --overwrite to replace it.' >&2 +end + +if set -ql _flag_overwrite; or not test -e ~/.config/jj/config.toml + mkdir -p ~/.config/jj + cp ./assets/jj/config.toml ~/.config/jj/ + sed -i '' "s/{{ VCS_EMAIL }}/$_flag_email/" ~/.config/jj/config.toml + sed -i '' "s/{{ VCS_NAME }}/$_flag_full_name/" ~/.config/jj/config.toml +else + echo 'JJ config already exists. Use --overwrite to replace it.' >&2 +end + +if set -ql _flag_overwrite; or not test -e ~/.config/helix + if test -e ~/.config/helix + rm -r ~/.config/helix + end + cp -r ./assets/helix ~/.config/helix +else + echo 'Helix configs already exist. Use --overwrite to replace them.' >&2 +end + +if set -ql _flag_install_mise + brew install mise + if set -ql _flag_overwrite; or not test -e ~/.config/mise/config.toml + mkdir -p ~/.config/mise + cp ./assets/mise/config.toml ~/.config/mise/ + else + echo 'Mise config already exists. Use --overwrite to replace it.' >&2 + end + mise install +end