diff --git a/README.md b/README.md index e0c062b..9eaa917 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ If you are forking this repository, don't forget to change the following places: - [`scripts/install_dotfiles.sh`](./scripts/install_dotfiles.sh) - Replace all occurrences of `felipecrs` with `` - [`home/.chezmoi.yaml.tmpl`](./home/.chezmoi.yaml.tmpl) - - Change the name and email to yours. + - Optional: add your name and email. Where `` is your GitHub username. diff --git a/home/.chezmoi.yaml.tmpl b/home/.chezmoi.yaml.tmpl index d4ce5c2..00cb8f5 100644 --- a/home/.chezmoi.yaml.tmpl +++ b/home/.chezmoi.yaml.tmpl @@ -1,6 +1,3 @@ -{{- $name := "Felipe Santos" -}} -{{- $email := "felipecassiors@gmail.com" -}} - {{- $chezmoiForce := or (has "--force" .chezmoi.args) (has "--force=true" .chezmoi.args) -}} {{- $interactive := and stdinIsATTY (not $chezmoiForce) -}} @@ -10,8 +7,7 @@ {{- $gnome := lookPath "gnome-shell" | not | not -}} {{- $headless := or (env "SSH_CLIENT" | not | not) (not (or (env "DISPLAY") (env "WAYLAND_DISPLAY"))) -}} -{{- $minimum := or $devcontainer (not $ubuntu) -}} - +{{- $name := "" -}} {{- if hasKey . "name" -}} {{- $name = .name -}} {{- end -}} @@ -37,6 +33,7 @@ {{- end -}} {{- end -}} +{{- $email := "" -}} {{- if hasKey . "email" -}} {{- $email = .email -}} {{- end -}} @@ -63,6 +60,7 @@ {{- end -}} {{- end -}} +{{- $minimum := or $devcontainer (not $ubuntu) -}} {{- if hasKey . "is_devcontainer" -}} {{- $minimum = .is_devcontainer -}} {{- end -}} diff --git a/home/dot_gitconfig.tmpl b/home/dot_gitconfig.tmpl index 9868065..d3c99e0 100644 --- a/home/dot_gitconfig.tmpl +++ b/home/dot_gitconfig.tmpl @@ -1,7 +1,13 @@ +{{ if or .name .email -}} [user] -name = {{ .name }} -email = {{ .email }} - +{{- with .name }} +name = {{ . }} +{{- end }} +{{- with .email }} +email = {{ . }} +{{- end }} + +{{ end -}} [core] editor = {{ .editor }}