From 595ccb984616ed32dceb98087994cdae2b710b01 Mon Sep 17 00:00:00 2001 From: Peter van Gulik Date: Fri, 16 Aug 2024 13:46:08 +0200 Subject: [PATCH] fix: line ending differences in text files can cause delta compare to fail --- packages/salesforce/src/retrieveDeltaStrategy.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/salesforce/src/retrieveDeltaStrategy.ts b/packages/salesforce/src/retrieveDeltaStrategy.ts index ef50f603..9e7fb732 100644 --- a/packages/salesforce/src/retrieveDeltaStrategy.ts +++ b/packages/salesforce/src/retrieveDeltaStrategy.ts @@ -1,9 +1,9 @@ import { injectable, LifecyclePolicy, Logger } from "@vlocode/core"; import { CancellationToken, deepCompare, remove, XML } from "@vlocode/util"; import { RetrieveManifestOptions, SalesforceDeployService } from "./salesforceDeployService"; -import { SalesforcePackage, SalesforcePackageComponent } from "./deploymentPackage"; import { MetadataRegistry, MetadataType } from "./metadataRegistry"; import { RetrieveResultComponent } from "./deploy"; +import { SalesforcePackage, SalesforcePackageComponent } from "./deploy/package"; /** * Interface for a strategy to determine if two objects are equal. Used in the delta strategy to determine if a component has changed. @@ -244,8 +244,8 @@ export class RetrieveDeltaStrategy { } private isStringEqual(a: Buffer | string, b: Buffer | string): boolean { - a = (typeof a === 'string' ? a : a.toString('utf8')).trim(); - b = (typeof b === 'string' ? b : b.toString('utf8')).trim(); + a = (typeof a === 'string' ? a : a.toString('utf8')).replace(/\r\n/g, '\n').trim(); + b = (typeof b === 'string' ? b : b.toString('utf8')).replace(/\r\n/g, '\n').trim(); return a.localeCompare(b) === 0; }