fix: don't strip last folder from dir when resolving projectDir #660
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes
NonDecompositionFinalizer
finalizer resolving metadata components from the top-level folder when passing a dir path that is exactly one level below the project dir.When running
sfdx force:mdapi:convert -r mdapi -d src
plugin-source sets the
outputDirectory
to:/Users/cdominguez/code/sfdx-project/src
which then in this line:
source-deploy-retrieve/src/convert/convertContext.ts
Line 276 in 7804d44
dirname
strips the last folder after the last/
soand last SDR uses the projectDir to get the compSet from source, which walks the tree, scans customlabels in other folders with other dir (other src, mdapi, etc) and make this line return the wrong parentKey.
source-deploy-retrieve/src/convert/convertContext.ts
Line 215 in 7804d44
What issues does this PR fix or reference?
forcedotcom/cli#1540
@W-11186731@
Functionality Before
NonDecompositionFinalizer
scans components in root project dir which causes issues when components are found in other folders (mdapi
, etc).Functionality After