forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
493 stars 78 forks source link

SFDX: Retrieve for a static resource file, creates a duplicate nested folder. #926

Closed adityababbar closed 2 years ago

adityababbar commented 3 years ago

Summary

SFDX: Retrieve for a static resource file, creates a duplicate nested folder.

Steps To Reproduce:

  1. Open a static resource and go to any file ( e.g. a .js file).
  2. Do a SFDX: Retrieve on that file.

Expected result

The file should be retrieved with the directory structure of the static resource folder remaining intact.

Actual result

A duplicate nested folder is created with content refreshed in the sub directory where the file refreshed is located. The content of the file changes to following <?xml version="1.0" encoding="UTF-8"?>

Private application/x-zip-compressed Detail page resources (JS/CSS/etc)

Additional information

image

VS Code Version: 1.53.2

SFDX CLI Version: 51.2.0

OS and version: Window 10, 10.0.17763 Build 17763

lcampos commented 3 years ago

Hi @adityababbar thanks for logging this issue. I remember seeing this bug in an old version of the Salesforce CLI a few weeks ago. Can you tell us which version of the CLI you are using (run sfdx version on your terminal) ? If you are not in the latest version, can you try updating the CLI (sfdx update) and re-running the retrieve to check if it still fails ?

adityababbar commented 3 years ago

@lcampos Thanks a lot for your reply. Current version is sfdx-cli/7.84.2-a2868a68d5 win32-x64 node-v12.18.3. Let me try updating it and try again.

adityababbar commented 3 years ago

@lcampos : Updated CLI to version sfdx-cli/7.89.2-d1d2614d02 win32-x64 node-v14.15.4. Still the same issue is happening

mshanemc commented 2 years ago

This works for me in the new plugin-source from the CLI

➜  748 sfdx force:source:retrieve -p force-app/main/default/staticresources/test/hi.js 
Preparing retrieve request... done
=== Retrieved Source
FULL NAME  TYPE            PROJECT PATH
─────────  ──────────────  ─────────────────────────────────────────────────────────────
test       StaticResource  force-app/main/default/staticresources/test.resource-meta.xml
test       StaticResource  force-app/main/default/staticresources/test/hi.js

If it's a problem in vscode, please open another repro there https://github.com/forcedotcom/salesforcedx-vscode