-
Notifications
You must be signed in to change notification settings - Fork 300
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
Support $relativeDir as executorMap parameter #559
Comments
Managed to work around it by setting "code-runner.executorMap": {
"php": "docker-compose exec -T --env codeRunnerFile=$(realpath --relative-to=${PWD} $fullFileName) my-container bash -c \"php -d display_errors=1 -d /container/path/toProject/\\${codeRunnerFile}\""
},
"code-runner.fileDirectoryAsCwd": false |
In go, I need to execute My config now: "code-runner.cwd": "",
"code-runner.fileDirectoryAsCwd": true,
"code-runner.executorMap": {
"go": "go run $dir"
} When Run Code: g:\Projects\demo1\cmd>go run "g:\Projects\demo1\cmd\"
CreateFile g:\Projects\demo1\cmd": The filename, directory name, or volume label syntax is incorrect. I'd like to have this: go run . When I change config to this: "code-runner.cwd": "",
"code-runner.fileDirectoryAsCwd": true,
"code-runner.executorMap": {
"go": "go run $dirWithoutTrailingSlash"
} If I put G:\Projects\demo1>go run "g:\Projects\demo1"
directory . outside available modules I'd like to have this: go run . If I put So the best way to have is: Config like this, but relative path if based on "code-runner.cwd": "",
"code-runner.fileDirectoryAsCwd": true,
"code-runner.executorMap": {
"go": "go run $relativeDirWithoutTrailingSlash"
} I hope to get this: go run . |
$relativeDir would be a great feature. |
yes, I it is reaaly useful to imlement such vars as is in VS CODE: Workaround works, thank you! |
It seems that the addition of this variable is still a long way off, so I provide a temporary alternative.
For example, I use the following configuration to run cmake to generate executable files under "code-runner.executorMap": {
"cpp": "./build/`realpath -s --relative-to=$workspaceRoot $dir`/$fileNameWithoutExt",
}, Of course, this does not look elegant, but at least it is an optional solution. |
My project is running inside a docker container, and I'd like to create a custom execute command to run the file inside the container. However as there is no parameter for relative path I'm unable to build a command that would be able to locate the file inside the container.
The closest I can get is this:
But that doesn't work since the path to the file is completely different inside the container.
Solution
Relative path parameter:
The text was updated successfully, but these errors were encountered: