The espressif SDK has a specific build command, namely idf.py build, which will build the current app. For this to work it needs to have some enivornment variables exported into the same terminal context first. This is usually done with the command export.bat from the repo directory.
I want to automate this so that I don't have to manually type in export.bat whenever I open the project folder in the morning. I tried to place the following tasks.json inside the .vscode folder in my project root:
tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "Run export for ESP-IDF",
"type": "shell",
"command": "${env:IDF_PATH}/export.bat",
"runOptions": {
"runOn": "folderOpen"
},
"presentation": {
"reveal": "always",
"panel": "shared",
"focus": true
}
}
]
}
Even though it works the problem is that the startup script will execute in a seperate terminal, that I have to close afterwards. And exporting the variable into a temporary terminal is useless. How can I have VSCode run the script for the current terminal that I'm later going to use?