Skip to content

Commit

Permalink
fix: path normalizing for metadata keys
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Sep 16, 2021
1 parent ebfb1f2 commit 6190590
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/shared/metadataKeys.ts
Expand Up @@ -4,9 +4,9 @@
* Licensed under the BSD 3-Clause license.
* 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 { RemoteSyncInput } from './types';
import { getMetadataKey } from './remoteSourceTrackingService';

// LWC can have child folders (ex: dynamic templates like /templates/noDataIllustration.html
const pathAfterFullName = (fileResponse: RemoteSyncInput): string =>
fileResponse && fileResponse.filePath
Expand All @@ -18,7 +18,7 @@ const pathAfterFullName = (fileResponse: RemoteSyncInput): string =>
export const getMetadataKeyFromFileResponse = (fileResponse: RemoteSyncInput): string[] => {
// also create an element for the parent object
if (fileResponse.type === 'CustomField' && fileResponse.filePath) {
const splits = fileResponse.filePath.split('/');
const splits = path.normalize(fileResponse.filePath).split(path.sep);
const objectFolderIndex = splits.indexOf('objects');
return [
getMetadataKey('CustomObject', splits[objectFolderIndex + 1]),
Expand Down

0 comments on commit 6190590

Please sign in to comment.