Skip to content
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

Slashes problems in VS Code on Windows #25

Open
abiliocastro opened this issue Aug 12, 2019 · 13 comments
Open

Slashes problems in VS Code on Windows #25

abiliocastro opened this issue Aug 12, 2019 · 13 comments

Comments

@abiliocastro
Copy link

abiliocastro commented Aug 12, 2019

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.

@alexkli
Copy link
Contributor

alexkli commented Aug 13, 2019

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.

@abiliocastro
Copy link
Author

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

@abiliocastro
Copy link
Author

abiliocastro commented Aug 13, 2019

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.

@alexkli
Copy link
Contributor

alexkli commented Aug 13, 2019

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

@abiliocastro
Copy link
Author

Thanks @alexkli I will try it.

@abiliocastro
Copy link
Author

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

@lheinman
Copy link

@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?

@abiliocastro
Copy link
Author

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

@lheinman
Copy link

lheinman commented Aug 21, 2019

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

@watopin
Copy link

watopin commented Nov 5, 2020

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

@abetoots
Copy link

Did you get it to work @watopin @abiliocastro ?

@abiliocastro
Copy link
Author

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

@watopin
Copy link

watopin commented Nov 14, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants