Skip to content

Commit

Permalink
Add huge/env/GetVar
Browse files Browse the repository at this point in the history
Fixes #61
  • Loading branch information
regisphilibert committed Mar 9, 2022
1 parent a213ea1 commit e00bdfb
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 e00bdfb

Please sign in to comment.