Skip to content

Commit 595ccb9

Browse files
committed
fix: line ending differences in text files can cause delta compare to fail
1 parent 4850446 commit 595ccb9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/salesforce/src/retrieveDeltaStrategy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { injectable, LifecyclePolicy, Logger } from "@vlocode/core";
22
import { CancellationToken, deepCompare, remove, XML } from "@vlocode/util";
33
import { RetrieveManifestOptions, SalesforceDeployService } from "./salesforceDeployService";
4-
import { SalesforcePackage, SalesforcePackageComponent } from "./deploymentPackage";
54
import { MetadataRegistry, MetadataType } from "./metadataRegistry";
65
import { RetrieveResultComponent } from "./deploy";
6+
import { SalesforcePackage, SalesforcePackageComponent } from "./deploy/package";
77

88
/**
99
* 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 {
244244
}
245245

246246
private isStringEqual(a: Buffer | string, b: Buffer | string): boolean {
247-
a = (typeof a === 'string' ? a : a.toString('utf8')).trim();
248-
b = (typeof b === 'string' ? b : b.toString('utf8')).trim();
247+
a = (typeof a === 'string' ? a : a.toString('utf8')).replace(/\r\n/g, '\n').trim();
248+
b = (typeof b === 'string' ? b : b.toString('utf8')).replace(/\r\n/g, '\n').trim();
249249
return a.localeCompare(b) === 0;
250250
}
251251

0 commit comments

Comments
 (0)