franneck94 / Vscode-C-Cpp-Runner

🚀 Compile, run and debug single or multiple C/C++ files with ease. 🚀
MIT License
53 stars 14 forks source link

Do not work on Nushell #156

Open ghost opened 5 months ago

ghost commented 5 months ago

Hello. This plugin don't work on Nushell. Because the && operator is not support on Nushell.

One resolve method is replace && to ;. But it always runs the next command, even if this command failed. There is a environment variable named LAST_EXIT_CODE. Also see Nushell Book.

command1
if $env.LAST_EXIT_CODE == 0 {
    command2
}

https://github.com/franneck94/Vscode-C-Cpp-Runner/blob/ba8462b7c44289c02197bda07485ec13974f6322/src/executor/builder/unix/unix_utils.ts#L18 https://github.com/franneck94/Vscode-C-Cpp-Runner/blob/ba8462b7c44289c02197bda07485ec13974f6322/src/executor/builder/win/msvc.ts#L218 https://github.com/franneck94/Vscode-C-Cpp-Runner/blob/ba8462b7c44289c02197bda07485ec13974f6322/src/executor/builder/unix/gcc_clang.ts#L149 https://github.com/franneck94/Vscode-C-Cpp-Runner/blob/ba8462b7c44289c02197bda07485ec13974f6322/src/executor/builder/unix/cuda.ts#L123

Thank you for provide this extensions.