Skip to content

Commit

Permalink
fix env var declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
mmena1 committed Mar 14, 2024
1 parent 9976a15 commit f146ce2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions home/.chezmoi.toml.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- $email := "example@email.com" -}}
{{- if env "dev" -}}
{{- if eq (env "dev") "true" -}}
{{- $email = promptStringOnce . "email" "Email address" -}}
{{- end -}}
{{- $osid := .chezmoi.os -}}
Expand All @@ -11,4 +11,3 @@
[data]
email = {{ $email | quote }}
osid = {{ $osid | quote }}
dev = {{ env "dev" | default true }}
2 changes: 1 addition & 1 deletion home/.chezmoiscripts/run_before_00-intro.sh.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ if .dev -}}
{{ if eq (env "dev") "true" -}}
{{ template "common" . -}}
{{ template "dotfile" }}

Expand Down
2 changes: 1 addition & 1 deletion home/.chezmoiscripts/run_once_after_04-ssh-keys.sh.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ if .dev -}}
{{ if eq (env "dev") "true" -}}
{{ template "common" . -}}

set_ssh_keys() {
Expand Down
2 changes: 1 addition & 1 deletion home/.chezmoitemplates/common
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function error() {
}

function prompt {
{{ if .dev -}}
{{ if eq (env "dev") "true" -}}
read -rp "$1 [y/N]" -n 1 -r -s answer
{{ else -}}
answer="y"
Expand Down

0 comments on commit f146ce2

Please sign in to comment.