Skip to content

Commit

Permalink
.bashrc: Fix syntax due to constraints of Go text/template
Browse files Browse the repository at this point in the history
Notes: Go `text/template` does not support ...

 - dynamic template name due to golang/go#33449
 - switch/case statements
  • Loading branch information
trinitronx committed Aug 27, 2024
1 parent 5e1eb26 commit fcd947c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions dot_bashrc.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{{- if eq .chezmoi.os "linux" -}}
{{- $bashrcTmpl := (printf "bash/dot_bashrc.%s" .chezmoi.osRelease.id) -}}
{{- template "$bashrcTmpl" . -}}
{{- if eq .chezmoi.osRelease.id "ubuntu" -}}
{{- template "bash/dot_bashrc.ubuntu" . -}}
{{- else if eq .chezmoi.osRelease.id "manjaro" -}}
{{- template "bash/dot_bashrc.manjaro" . -}}
{{- end -}}
{{- else if eq .chezmoi.os "darwin" -}}
{{- template "bash/dot_bashrc.macOS" . -}}
{{- template "bash/dot_bashrc.macOS" . -}}
{{- end -}}

0 comments on commit fcd947c

Please sign in to comment.