You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using task to write cross-platform tasks and in doing so, I need to work through any OS specific issues. One issue is with case sensitivity of environmental variables. The statement that env vars are case sensitive in this comment is true for *nix but not for Windows. Consider the following PowerShell.
Since Task treats environmental variables as case sensitive, I need to use the case sensitive form when used as {{.VAR}} but not when used as $ENV:Var. This is not a problem until I run a task in another task at which point Task will make all environmental variables uppercase in {{.VAR}}. This Taskfile.yaml demonstrates this.
Notice how $ProgramData and $PROGRAMDATA are the same because env vars are case insensitive on Windows. The docs state variables are populated (interpolated) with environmental variables being lowest importance. The translation from case-insensitive env vars to case-sensitive variables changes when Task calls itself, implying the internal env var representation is UPPERCASE and passed to future invocations within a task.
If environmental variables are case sensitive, the case should be preserved, even in sub-tasks such that {{.SOME_VAR}} works in call cases.
Also note that casting an env: to vars: using sh: | does not work in the main task (for reasons mentioned in other issues) but can be used to pass env vars consistently to sub-tasks using variables.
Feature Request: Make this work without checking both versions of the variable name interpolated from the environmental name. I recognize name=$ProgramData works but then I lose the richness of Go's templating, mainly osClean.
Note: This is probably specific to Windows since env vars are case sensitive in other OS's.
The text was updated successfully, but these errors were encountered:
I'm using task to write cross-platform tasks and in doing so, I need to work through any OS specific issues. One issue is with case sensitivity of environmental variables. The statement that env vars are case sensitive in this comment is true for *nix but not for Windows. Consider the following PowerShell.
Since Task treats environmental variables as case sensitive, I need to use the case sensitive form when used as
{{.VAR}}
but not when used as$ENV:Var
. This is not a problem until I run a task in another task at which point Task will make all environmental variables uppercase in{{.VAR}}
. ThisTaskfile.yaml
demonstrates this.Output:
Notice how
$ProgramData
and$PROGRAMDATA
are the same because env vars are case insensitive on Windows. The docs state variables are populated (interpolated) with environmental variables being lowest importance. The translation from case-insensitive env vars to case-sensitive variables changes when Task calls itself, implying the internal env var representation is UPPERCASE and passed to future invocations within a task.If environmental variables are case sensitive, the case should be preserved, even in sub-tasks such that
{{.SOME_VAR}}
works in call cases.Also note that casting an
env:
tovars:
usingsh: |
does not work in the main task (for reasons mentioned in other issues) but can be used to pass env vars consistently to sub-tasks using variables.Feature Request: Make this work without checking both versions of the variable name interpolated from the environmental name. I recognize
name=$ProgramData
works but then I lose the richness of Go's templating, mainlyosClean
.Note: This is probably specific to Windows since env vars are case sensitive in other OS's.
The text was updated successfully, but these errors were encountered: