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
Hi, guys. First issue here. What I'll describe is a task/terminal issue. I looked around the related repositories, but still think it fits here. Let me know if I'm wrong.
I'm using dependsOn to create a chain of tasks that run synchronously depending on the completion of the previous one. I have about five in a chain in a project I'm working on. To simplify task commands, I've removed some common information to environment variables and I'm referencing those using the $env:variable syntax.
This works, but only for the first task. To clarify, the first task is usually not the one I'm executing. Through a chain of dependsOn, the one I'm executing is actually the last one to be executed. But all tasks besides the first one fail, because the environment variables aren't being carried through.
To be clear, I'm not setting these variables per task. I'm setting them on the root of the tasks.json file. I'm using PowerShell for the integrated terminal, if that makes any difference.
Steps to Reproduce:
Create a tasks.json file with this minimal markup:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"options":
{
"env":
{
"Variable": "Issue with environment variables."
}
},
"tasks":
[
{
"command": "Write-Host Variable: $env:Variable",
"dependsOn": "First task",
"label": "Main task",
"problemMatcher": [],
"type": "shell"
},
{
"command": "Write-Host Variable: $env:Variable",
"label": "First task",
"problemMatcher": [],
"type": "shell"
}
]
}
Notice how the variable is set for the whole file, not for any individual task. Also notice how I'm not overriding options in any of the individual ones.
Hi, guys. First issue here. What I'll describe is a task/terminal issue. I looked around the related repositories, but still think it fits here. Let me know if I'm wrong.
I'm using dependsOn to create a chain of tasks that run synchronously depending on the completion of the previous one. I have about five in a chain in a project I'm working on. To simplify task commands, I've removed some common information to environment variables and I'm referencing those using the $env:variable syntax.
This works, but only for the first task. To clarify, the first task is usually not the one I'm executing. Through a chain of dependsOn, the one I'm executing is actually the last one to be executed. But all tasks besides the first one fail, because the environment variables aren't being carried through.
To be clear, I'm not setting these variables per task. I'm setting them on the root of the tasks.json file. I'm using PowerShell for the integrated terminal, if that makes any difference.
Steps to Reproduce:
Notice how the variable is set for the whole file, not for any individual task. Also notice how I'm not overriding options in any of the individual ones.
This is the output I'm getting:
Obviously, I wanted the variable to show up in both tasks.
Alright, that's it. Hope that was clear enough. Loving using the tool!
Reproduces without extensions: Yes
The text was updated successfully, but these errors were encountered: