tools icon indicating copy to clipboard operation
tools copied to clipboard

Slashes problems in VS Code on Windows

Open abiliocastro opened this issue 5 years ago • 13 comments

When I run a task like "repo put -f ${file}" I get the error: slash 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.

abiliocastro avatar Aug 12 '19 16:08 abiliocastro

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 avatar Aug 13 '19 05:08 alexkli

@alexkli How can I do that? Because I just have the repo executable. I have to compile somehow #21 improvements?

abiliocastro avatar Aug 13 '19 13:08 abiliocastro

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.

abiliocastro avatar Aug 13 '19 13:08 abiliocastro

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

alexkli avatar Aug 13 '19 15:08 alexkli

Thanks @alexkli I will try it.

abiliocastro avatar Aug 13 '19 16:08 abiliocastro

Updating: The problem still persists. But now I have /cygdrive/c before Usersabilio... like the image below: persists

abiliocastro avatar Aug 20 '19 12:08 abiliocastro

@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 avatar Aug 21 '19 03:08 lheinman

@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 avatar Aug 21 '19 11:08 abiliocastro

@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": [] } ] }

lheinman avatar Aug 21 '19 22:08 lheinman

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

watopin avatar Nov 05 '20 08:11 watopin

Did you get it to work @watopin @abiliocastro ?

abetoots avatar Nov 11 '20 03:11 abetoots

@abetoots I'm sorry. I'm not working with it now. I remember I don't tested out the last solution pointed by @lheinman

abiliocastro avatar Nov 11 '20 04:11 abiliocastro

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.

watopin avatar Nov 14 '20 01:11 watopin