Skip to content

Commit

Permalink
fix: line ending differences in text files can cause delta compare to…
Browse files Browse the repository at this point in the history
… fail
  • Loading branch information
Codeneos committed Aug 16, 2024
1 parent 4850446 commit 595ccb9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/salesforce/src/retrieveDeltaStrategy.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 595ccb9

Please sign in to comment.