Dax89 / automaton.nvim

VSCode-Like Workspace Configuration Manager
MIT License
36 stars 3 forks source link

Escaping characters does not work #9

Closed lobneroO closed 2 months ago

lobneroO commented 2 months ago

I tried to set a path which may have spaces in it. Due to that, I wanted to put it in double quotes for a cmake call.

This is the tasks code:

// tasks
{
    version: "1.0.0",

    tasks: [
        {
            name: "Configure MSVC",
            cwd: "${workspace_folder}",
            type: "shell",
            command: "cmake -S \"${workspace_folder}\" -B ${workspace_folder}/build/msvc -DCMAKE_PREFIX_PATH=${ws.qt_msvc_path}"
        },
        {
            name: "Build Debug MSVC",
            cwd: "${workspace_folder}",
            type: "shell",
            command: "cmake --build ${workspace_folder}\\build\\msvc",
            depends: ["Configure MSVC"],
            default: true,
            quickfix: true,
        },
    ]
}

For some reason, this does not really get executed. The command gets printed for a short time before opening what looks like a terminal (see video). But apart from that, it does not correctly escape the double quotes. Instead, the printed command also contains the backslashes. Since this does not execute anyway, I'm not 100% sure this is an actual bug, but it certainly looks wrong to me.

https://github.com/Dax89/automaton.nvim/assets/17877050/fc48a5a3-5f95-45db-8be9-7088c9fd0fe6

Dax89 commented 2 months ago

I have made some changes in this commit which improves escape parsing.

If needed, there are also alternative ways to set command key, see here: https://github.com/Dax89/automaton.nvim/wiki/Tasks.json-schema