Skip to content

Commit

Permalink
Merge pull request #62 from theNewDynamic/61-env-getvar
Browse files Browse the repository at this point in the history
Add huge/env/GetVar
  • Loading branch information
regisphilibert authored Mar 9, 2022
2 parents a213ea1 + e00bdfb commit b04ec15
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions core/env/GetVar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{/*
huge/env/GetVar
Returns an environment variable from getenv or _huge/config/env.yaml

@author @regisphilibert

@context String

@access public

@uses
- huge/config/Get

@returns String
*/}}

{{ $var := "" }}
{{ with getenv . }}
{{ $var = . }}
{{ else }}
{{ with partialCached "huge/config/Get" "env" "env" }}
{{ with index . $ }}
{{ $var = . }}
{{ end }}
{{ end }}
{{ end }}

{{ return $var }}

0 comments on commit b04ec15

Please sign in to comment.