diff --git a/home/dot_profile.tmpl b/home/dot_profile.tmpl index 6cdb0252..955b3eb3 100644 --- a/home/dot_profile.tmpl +++ b/home/dot_profile.tmpl @@ -29,16 +29,17 @@ LS_COLORS={{ output "pkgx" "vivid" "--color-mode" "8-bit" "generate" "one-dark" # GitHub {{- $output := output "sh" "-c" "pkgx gh api https://api.github.com/user 2>/dev/null || true" -}} -{{- if $output -}} -{{- $json := (fromJson $output | default dict) -}} -{{- if and (index $json "login") (index $json "name") (index $json "id") }} -GITHUB_USER={{ $json.login | quote }} -GIT_AUTHOR_NAME={{ $json.name | quote }} -GIT_AUTHOR_EMAIL={{ printf "%v+%s@users.noreply.github.com" $json.id $json.login | quote }} +{{- if $output }} +{{- with (fromJson $output) -}} +{{- if and (index . "login") (index . "name") (index . "id") }} +GITHUB_USER={{ .login | quote }} +GIT_AUTHOR_NAME={{ .name | quote }} +GIT_AUTHOR_EMAIL={{ printf "%v+%s@users.noreply.github.com" .id .login | quote }} GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL {{- end }} {{- end }} +{{- end }} # Bash BASH_SILENCE_DEPRECATION_WARNING=1