From 3cd64888ec705a28069c7ad2d5329e097884d40b Mon Sep 17 00:00:00 2001 From: Beyang Liu Date: Mon, 9 Jul 2018 11:57:26 -0700 Subject: [PATCH] remove expandedString helper --- templates/_helpers.tpl | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index 21a9a0afe594..9d127c85f600 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -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\"" -}} @@ -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) -}} @@ -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" -}}