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

fix: windows path replacements #958

Merged
merged 5 commits into from
May 5, 2023
Merged

Conversation

mshanemc
Copy link
Contributor

@mshanemc mshanemc commented May 5, 2023

What does this PR do?

smarter matching of file paths for replacements on windows

What issues does this PR fix or reference?

forcedotcom/cli#1885
@W-12398244@

Release Notes

Metadata string replacements were working inconsistently on windows depending on what shell you used. Special thanks to micha79x for a love repro/repo and doing most of the detective work on this one.

@mshanemc mshanemc requested a review from a team as a code owner May 5, 2023 13:33
@WillieRuemmele
Copy link
Member

QA Notes


on windows 11 command prompt
in the users reproduction repo 🏆

before:

C:\Users\willi\projects\sfdx-replacement-issue>SET
ALLUSERSPROFILE=C:\ProgramData
...
SF_APPLY_REPLACEMENTS_ON_CONVERT=true
C:\Users\willi\projects\sfdx-replacement-issue> sfdx force:source:convert --outputdir mdapiOut --sourcepath force-app
Warning: The "force source convert" command has been deprecated. Use "project convert source" instead.
Warning: The "--outputdir" flag has been deprecated. Use "--output-dir | -d" instead.
Warning: The "--sourcepath" flag has been deprecated. Use "--source-dir | -p" instead.
Source was successfully converted to Metadata API format and written to the location: C:\Users\willi\projects\sfdx-replacement-issue\mdapiOut

<this should have error'd>

AFTER: ✅

C:\Users\willi\projects\sfdx-replacement-issue>SET
ALLUSERSPROFILE=C:\ProgramData
...
SF_APPLY_REPLACEMENTS_ON_CONVERT=true

and linking SDR through PDR

C:\Users\willi\projects\sfdx-replacement-issue>node ../plugin-deploy-retrieve/bin/dev force:source:convert --outputdir mdapiOut --sourcepath force-app
Warning: The "force source convert" command has been deprecated. Use "project convert source" instead.
Warning: The "--outputdir" flag has been deprecated. Use "--output-dir | -d" instead.
Warning: The "--sourcepath" flag has been deprecated. Use "--source-dir | -p" instead.
Error (1): The file "replacementFiles/latest-api-version.txt" specified in the "replacements" property of sfdx-project.json could not be read.

✅ : on the with-glob-property branch, it will error correctly, confirmed, and with local changes, continues to error

@WillieRuemmele WillieRuemmele merged commit b71932b into main May 5, 2023
@WillieRuemmele WillieRuemmele deleted the sm/windows-replacements branch May 5, 2023 20:44
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

Successfully merging this pull request may close these issues.

3 participants