tools
tools copied to clipboard
Slashes problems in VS Code on Windows
When I run a task like "repo put -f ${file}"
I get the error:
I think this problem is related with
${file}
variable that gets the path to the file in a Windows like slash style.
When I manually change it to a unix like slash style it works.
Check out #21 and let us know whether it fixes the problem.
I haven’t had a chance to test and review it, but would like to merge it soon.
@alexkli How can I do that? Because I just have the repo executable. I have to compile somehow #21 improvements?
At the moment I'm using Linux/Unix/WSL paths extension to workaround it. But it have only the command ${command:wsl-path.getRelativePath}
which return file's path. I also need the command to return folder's path.
It’s all shell scripts, no compilations necessary. Just download the latest version from the PR/branch which would be here: https://github.com/lheinman/tools/tree/master/repo
And make sure to follow the updated Windows instructions in there: https://github.com/lheinman/tools/blob/master/repo/README.md
/cc @lheinman
Thanks @alexkli I will try it.
Updating: The problem still persists. But now I have /cygdrive/c
before Usersabilio...
like the image below:
@abiliocastro, if you are using Linux/Unix/WSL, you need to call the repoWin.ps1
Powershell wrapper script in your key binding, see https://github.com/lheinman/tools/blob/master/repo/README.md. it looks like you are calling the bash repo
script directly instead. Can you post your key binding, by any chance?
@lheinman I'm using Cygwin and I'm not using keybiding just tasks.json
which has the following content:
// .vscode/tasks.json
{
// examples of using repo to push and pull files and folders from a server running at localhost:4502
// the tasks with folders actions will be perfomed on the folder of the current file open in the editor
// see https://code.visualstudio.com/docs/editor/variables-reference for more details
"version": "2.0.0",
"tasks": [
{
"label": "put file",
"type": "shell",
"command": "repo put -f ${file}",
"problemMatcher": []
},
{
"label": "put folder",
"type": "shell",
"command": "repo put -f ${fileDirname}",
"problemMatcher": []
},
{
"label": "get file",
"type": "shell",
"command": "repo get -f ${file}",
"problemMatcher": []
},
{
"label": "get folder",
"type": "shell",
"command": "repo get -f ${fileDirname}",
"problemMatcher": []
}
]
}
@abiliocastro, can you try this version of tasks.json instead (you may need to update the path to repoWin.ps1): { "version": "2.0.0", "tasks": [ { "label": "put file", "type": "shell", "command": "C:\dev\tools\repo\repoWin.ps1 put ${file}", "problemMatcher": [] }, { "label": "put folder", "type": "shell", "command": "C:\dev\tools\repo\repoWin.ps1 put ${fileDirname}", "problemMatcher": [] }, { "label": "get file", "type": "shell", "command": "C:\dev\tools\repo\repoWin.ps1 get ${file}", "problemMatcher": [] }, { "label": "get folder", "type": "shell", "command": "C:\dev\tools\repo\repoWin.ps1 get ${fileDirname}", "problemMatcher": [] } ] }
I'm facing the same problem now, and I've reached at this page. Could you tell me where I can get repoWin.ps1 file?
Sorry I found it. https://github.com/lheinman/tools/blob/master/repo/repoWin.ps1
Did you get it to work @watopin @abiliocastro ?
@abetoots I'm sorry. I'm not working with it now. I remember I don't tested out the last solution pointed by @lheinman
I tried using repoWin.ps1 and task.json @lheinman posted, and I succeeded to file transport between jcr and vscode.
NOTE: I found that it doesn't work with WSL version 2. Use WSL version 1.