commit fe9a854b5b4ecb690af6233aa118d0d5b40f6966 from: Sara Burke date: Sun Feb 15 03:07:53 2026 UTC add POSIX installation script and remove `dot` alias commit - 11fee02d37644c27985762113f264d4c6dcfd3c1 commit + fe9a854b5b4ecb690af6233aa118d0d5b40f6966 blob - db3a0e5d109543496f98399145465956c7630959 blob + 62a83e8007334f149f69084e8684163b2919ad04 --- .shrc +++ .shrc @@ -37,7 +37,6 @@ alias ga='git add' gmv='git mv' grm='git rm' alias gc='git commit' gca='gc --amend' gt='git tag' alias gp='git push' gu='git pull' gf='git fetch' alias gr='git rebase' grc='git rebase --continue' -alias dot='git --git-dir=$HOME/.dotfiles --work-tree=$HOME' # gpg alias # https://github.com/drduh/YubiKey-Guide?tab=readme-ov-file#using-keys blob - /dev/null blob + 07e59626eabf7bd3886b84db3f03c181060a8b7e (mode 644) --- /dev/null +++ install.sh @@ -0,0 +1,37 @@ +#!/bin/sh +set -eu + +dotdir="$(cd "$(dirname "$0")" && pwd)" + +files=$(find "$dotdir" -type f \ + ! -name install.sh \ + ! -name README.md \ + ! -name CLAUDE.md \ + ! -path '*/.got/*' \ + ! -path '*/.claude/*' \ + | sed "s|^$dotdir/||") + +uninstall=0 +case "${1:-}" in + -u | --uninstall) uninstall=1 ;; + "") ;; + *) + echo "usage: ${0##*/} [-u | --uninstall]" >&2 + exit 1 + ;; +esac + +for f in $files; do + target="$HOME/$f" + + if [ "$uninstall" -eq 1 ]; then + if [ -L "$target" ]; then + rm "$target" + echo "removed $target" + fi + else + mkdir -p "$(dirname "$target")" + ln -sf "$dotdir/$f" "$target" + echo "linked $target -> $dotdir/$f" + fi +done