Skip to content

Commit

Permalink
fix: sourceMember excepton for nondecomposed children
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Jan 10, 2022
1 parent 554c766 commit 05db59e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/shared/metadataKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import * as path from 'path';
import { ComponentSet } from '@salesforce/source-deploy-retrieve';
import { RemoteSyncInput } from './types';
import { getMetadataKey } from './functions';

Expand Down Expand Up @@ -39,7 +40,14 @@ export const getMetadataKeyFromFileResponse = (fileResponse: RemoteSyncInput): s
getMetadataKey(fileResponse.type, fileResponse.fullName),
];
}
// standard key
// CustomLabels (file) => CustomLabel[] (how they're storedin SourceMembers)
if (fileResponse.type === 'CustomLabels' && fileResponse.filePath) {
return ComponentSet.fromSource(fileResponse.filePath)
.getSourceComponents()
.toArray()
.flatMap((component) => component.getChildren().map((child) => getMetadataKey('CustomLabel', child.fullName)));
}
// standard key for everything else
return [getMetadataKey(fileResponse.type, fileResponse.fullName)];
};

Expand Down

0 comments on commit 05db59e

Please sign in to comment.