Skip to content

Commit

Permalink
remove expandedString helper
Browse files Browse the repository at this point in the history
  • Loading branch information
beyang committed Jul 9, 2018
1 parent 5c1b914 commit 3cd6488
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@
{{- $_ := set .envVars "HTML_HEAD_TOP" .Values.site.htmlHeadTop -}}
{{ end -}}

{{- if .Values.site.licenseKey -}}
{{- $_ := set .envVars "LICENSE_KEY" (include "expandedString" (dict "str" .Values.site.licenseKey "Files" .Files) | trimSuffix "\n" | printf "%q") -}}
{{- end -}}

{{- $_ := set .envVars "LSP_PROXY" "lsp-proxy:4388" -}}

{{- $_ := set .envVars "PUBLIC_REPO_REDIRECTS" "\"true\"" -}}
Expand Down Expand Up @@ -170,7 +166,7 @@
]

{{- else if (typeIsLike "string" .val) -}}
{{ include "expandedString" (dict "str" .val "Files" .Files) | printf "%q" }}
{{ if not .val }}""{{ else }}{{ printf "%q" .val }}{{ end }}
{{- else if (typeIsLike "float64" .val) -}}
{{ printf "%g" .val }}
{{- else if (typeIsLike "bool" .val) -}}
Expand All @@ -185,22 +181,6 @@

{{/* --------------- START OF TEMPLATE ------------- */}}

{{/* If a string begins with "file!", emits the contents of the file named by everything after the "file!" prefix. */}}
{{- define "expandedString" -}}
{{- $str := .str -}}
{{- $Files := .Files -}}

{{- if not $str -}}
{{- "" -}}
{{- else if (hasPrefix "file!" $str) -}}
{{ trimPrefix "file!" $str | $Files.Get }}
{{- else -}}
{{ $str }}
{{- end -}}
{{- end -}}

{{/* --------------- START OF TEMPLATE ------------- */}}

{{/* Sets the `.ret` field of the argument to true if the language specified by `.lang` is enabled */}}
{{- define "hasLanguage" -}}

Expand Down

0 comments on commit 3cd6488

Please sign in to comment.