Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

environmentSetupScript option does not execute the defined script #2391

Closed
DerJFK opened this issue Feb 21, 2022 · 2 comments
Closed

environmentSetupScript option does not execute the defined script #2391

DerJFK opened this issue Feb 21, 2022 · 2 comments

Comments

@DerJFK
Copy link

DerJFK commented Feb 21, 2022

I tried to use the environmentSetupScript option in the .vscode/cmake-kits.json to init my conda environment. However, if I define the script it seems not to run. In the following I describe my minimal example which does not work. Do I miss something?

The output window just shows:

[proc] Executing command: cmake --build build --config Debug --target all -j 18 --
├── .vscode
│   ├── cmake-kits.json
├── main.cpp
├── CMakeLists.txt
└── script.sh

.vscode/cmake-kits.json

[
    {
      "name": "Clang 12.0.0 MY",
      "compilers": {
        "C": "/bin/clang-12",
        "CXX": "/bin/clang++-12"
      },
      "environmentSetupScript" : " ${workspaceFolder}/script.sh"
    }
  ]

CMakeLists.txt

cmake_minimum_required(VERSION 3.23)
project(mytest CXX)
add_executable(main main.cpp)

script.sh

#!/bin/bash

source activate mytest
echo test >> file.txt
@bobbrow
Copy link
Member

bobbrow commented Feb 22, 2022

Can you remove the space before ${workspaceFolder} in " ${workspaceFolder}/script.sh" and try again? We currently quote this value when running it and it looks like we didn't trim it first.

@DerJFK
Copy link
Author

DerJFK commented Feb 23, 2022

Thanks for your answer. Now it works!

@DerJFK DerJFK closed this as completed Feb 23, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants