mkloubert / vs-deploy

Visual Studio Code extension that provides commands to deploy files of a workspace to a destination.
https://marketplace.visualstudio.com/items?itemName=mkloubert.vs-deploy
MIT License
131 stars 24 forks source link

[Help Wanted] [Error] Could not deploy file '<file>': Error: Could not get relative path for <file> #135

Open joaociocca opened 6 years ago

joaociocca commented 6 years ago

I have no idea what I'm doing wrong here. I went from a single folder workspace to a dual setup, one for dev, other for prd. Settings.json has both configurations, but I'm getting this error when I try to deploy a .jpg file inside /dev/img folder.

mkloubert commented 6 years ago

@joaociocca

Can you post an example of your settings?

joaociocca commented 6 years ago

Sorry, I forgot to do that and reverted to single folder... but I think I remember what I did, I can explain: base folder, something like C:\Project, contained a \dev and \prd folders. I opened them together on Code, and tried to setup two different targets - one for \dev deploy and the other for \prd, but when I tried to just deploy, nothing happened. Then I tried to deploy only that .jpg file, and the "Could not deploy" error showed up.

I'll see if I can get to that point again once I have some free time over here, then I'll post an example!

beebase commented 5 years ago

I have the same issue. Uploading from within a single project directory works ok, but when I move the directory into a workspace it errors with "Could not get relative path for.."

pyriand3r commented 5 years ago

I can confirm this behaviour. I have a big workspace with more or less 30-40 folders in it. I'm trying to set up deployment but get the same error when trying to deploy:

[Error] Could not deploy file '<file>': Error: Could not get relative path for <file>

The <file> is the absolute path of the file.

My deploy-config inside of workspace's settings.js:

"deploy": {
        "packages": [
            {
                "name": "module",
                "description": "app module",
                "files": [
                    "src/**/*",
                    "bin/*",
                    "plugin/*"
                ],
                "deployOnChange": true,
                "targets": [
                    "local wmware"
                ],

            }
        ],
        "targets": [
            {
                "type": "sftp",
                "name": "local vmware",
                "description": "A SFTP folder",
                "host": "192.168.73.137",
                "port": 22,
                "user": "root",
                "password": "***",
                "dir": "/opt",
                "mappings": [
                    {
                        "source": "src/frontend",
                        "target": "/opt/app/frontend/modules/module"
                    }
                ]
            }
        ]
    }

Using this config inside the single module folder works fine.

pyriand3r commented 5 years ago

Just tested. It works in deploy reloaded.