5

I am trying to deploy files to a non-source tracked org with the cli deploy command as follows:

sfdx force:source:deploy -u [ORG] -p "force-app/main/default/layouts/Snapshot__mdt-Snapshot Layout.layout-meta.xml"

but am getting this error:

ERROR running force:source:deploy:  The Layout named Snapshot__mdt-Snapshot Layout was not found in the workspace.

I've tried -p ''"[path/to/file]"'' and -p "\"[path/to/file]\"" and neither worked.

The file definitely exists and I am able to use the beta diff command from VSCode on this file.

So how do we include files with spaces in the name in our -p arg?

10
  • You need to use the " double quotes to be able to include space. Try prefixing ./ to the path like "./force-app/main/default/...". Commented Aug 10, 2020 at 15:16
  • 2
    No luck. Also any other file which doesn't contain spaces deploys fine with our without ./
    – Shanerk
    Commented Aug 10, 2020 at 15:18
  • 2
    This is happening from friday with me, all other deployments are failing on push command. For layouts only.
    – Ysr Shk
    Commented Aug 10, 2020 at 15:59
  • 1
    Key here is which OSX are you all on! Can we get OS information and versions ? Commented Aug 10, 2020 at 16:46
  • 1
    I am talking about the deploy command specifically, along with the -p argument and including files with spaces in the name as part of that argument. I have no problem with any other command nor deploy for files without spaces.
    – Shanerk
    Commented Aug 10, 2020 at 20:11

1 Answer 1

3

OK I figured it out on Mac OSX. For a single file -p works as follows:

sfdx force:source:deploy -p "force-app/main/default/layouts/Snapshot__mdt-Snapshot Layout.layout-meta.xml"

However, for multiple files with your -p argument, you need to surround each filename with escaped double quotes as follows:

sfdx force:source:deploy -p """force-app/main/default/layouts/SnapshotDetail__mdt-SnapshotDetail Layout.layout-meta.xml"",""force-app/main/default/layouts/Snapshot__mdt-Snapshot Layout.layout-meta.xml"""

And finally, another problem I had, make sure none of the files are in your .forceignore or you will get the Not Found In Workspace error.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .