Your name is an answer, not a constant
The :fn/:em espanso triggers hardcoded one person's name and email in a match file shipped to every user -- a misfire that lands inside their own prose, where they are least likely to notice. setup-identity now seeds match/identity.yml, per-machine and gitignored, from the same interview answers that already configure git.
This commit is contained in:
@@ -41,6 +41,26 @@ git config --global alias.st status
|
||||
git config --global pull.rebase true
|
||||
log "git aliases and pull.rebase applied"
|
||||
|
||||
# Text-expansion identity. The :fn/:em triggers used to hardcode the repository
|
||||
# owner's name and email in the shared match file; each machine now writes its
|
||||
# own from the interview's answers. Per-machine and gitignored -- espanso loads
|
||||
# every file under match/, so it sits beside base.yml without being shared.
|
||||
# Kept when it already exists: the file is the user's to edit, and a re-run
|
||||
# must not erase what they added.
|
||||
espanso_identity="${XDG_CONFIG_HOME:-$HOME/.config}/espanso/match/identity.yml"
|
||||
if [[ -d "$(dirname "$espanso_identity")" && ! -e "$espanso_identity" ]] \
|
||||
&& [[ -n "$git_name" || -n "$git_email" ]]; then
|
||||
{
|
||||
printf '# Personal expansion triggers, seeded from the install interview.\n'
|
||||
printf '# Per-machine and untracked: add your own freely.\n'
|
||||
printf 'matches:\n'
|
||||
[[ -n "$git_name" ]] && printf ' - trigger: ":fn"\n replace: "%s"\n' "$git_name"
|
||||
[[ -n "$git_email" ]] && printf ' - trigger: ":em"\n replace: "%s"\n' "$git_email"
|
||||
:
|
||||
} > "$espanso_identity"
|
||||
log "Seeded espanso identity triggers at $espanso_identity"
|
||||
fi
|
||||
|
||||
if [[ "${PANAMA_GH_LOGIN:-no}" == yes ]]; then
|
||||
if command -v gh >/dev/null 2>&1; then
|
||||
log "Signing in to GitHub"
|
||||
|
||||
Reference in New Issue
Block a user