@inforge/migrations-tools-cli 1.2.2 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +30 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -517,13 +517,30 @@ var TriggersHandler = class {
|
|
|
517
517
|
try {
|
|
518
518
|
const triggersDir = path3.join(tempDir, "force-app", "main", "default", "triggers");
|
|
519
519
|
await fs3.mkdir(triggersDir, { recursive: true });
|
|
520
|
-
|
|
520
|
+
const sfdxProjectJson = {
|
|
521
|
+
packageDirectories: [
|
|
522
|
+
{
|
|
523
|
+
path: "force-app",
|
|
524
|
+
default: true
|
|
525
|
+
}
|
|
526
|
+
],
|
|
527
|
+
name: "temp-trigger-deployment",
|
|
528
|
+
namespace: "",
|
|
529
|
+
sfdcLoginUrl: "https://login.salesforce.com",
|
|
530
|
+
sourceApiVersion: "60.0"
|
|
531
|
+
};
|
|
532
|
+
await fs3.writeFile(
|
|
533
|
+
path3.join(tempDir, "sfdx-project.json"),
|
|
534
|
+
JSON.stringify(sfdxProjectJson, null, 2),
|
|
535
|
+
"utf-8"
|
|
536
|
+
);
|
|
537
|
+
await this.logger.debug("Created temp deployment directory with SFDX project", { tempDir, triggersDir });
|
|
521
538
|
await this.logger.debug("Retrieving trigger source code");
|
|
522
539
|
for (const triggerName of triggerNames) {
|
|
523
540
|
try {
|
|
524
|
-
const retrieveCmd = `sf project retrieve start --metadata ApexTrigger:${triggerName} --target-org ${connection.getUsername()}
|
|
525
|
-
await this.logger.debug("Executing retrieve command", { command: retrieveCmd });
|
|
526
|
-
const { stdout: retrieveOut, stderr: retrieveErr } = await execAsync(retrieveCmd);
|
|
541
|
+
const retrieveCmd = `sf project retrieve start --metadata ApexTrigger:${triggerName} --target-org ${connection.getUsername()}`;
|
|
542
|
+
await this.logger.debug("Executing retrieve command", { command: retrieveCmd, cwd: tempDir });
|
|
543
|
+
const { stdout: retrieveOut, stderr: retrieveErr } = await execAsync(retrieveCmd, { cwd: tempDir });
|
|
527
544
|
await this.logger.debug("Retrieve result", { stdout: retrieveOut, stderr: retrieveErr });
|
|
528
545
|
const metadataPath = path3.join(triggersDir, `${triggerName}.trigger-meta.xml`);
|
|
529
546
|
const existingMetadata = await fs3.readFile(metadataPath, "utf-8");
|
|
@@ -539,13 +556,18 @@ var TriggersHandler = class {
|
|
|
539
556
|
throw error;
|
|
540
557
|
}
|
|
541
558
|
}
|
|
542
|
-
const deployCmd = `sf project deploy start --source-dir
|
|
543
|
-
await this.logger.debug("Executing deploy command", { command: deployCmd });
|
|
544
|
-
const { stdout: deployOut, stderr: deployErr } = await execAsync(deployCmd);
|
|
559
|
+
const deployCmd = `sf project deploy start --source-dir force-app --target-org ${connection.getUsername()}`;
|
|
560
|
+
await this.logger.debug("Executing deploy command", { command: deployCmd, cwd: tempDir });
|
|
561
|
+
const { stdout: deployOut, stderr: deployErr } = await execAsync(deployCmd, { cwd: tempDir });
|
|
545
562
|
await this.logger.debug("Deploy result", { stdout: deployOut, stderr: deployErr });
|
|
546
|
-
|
|
563
|
+
const isLocaleError = deployErr && deployErr.includes("Missing message metadata.transfer:Finalizing");
|
|
564
|
+
const deploySucceeded = deployOut && (deployOut.includes("Deploy Succeeded") || deployOut.includes("Status: Succeeded") || deployOut.includes("Deployment completed successfully"));
|
|
565
|
+
if (deployErr && !isLocaleError && !deploySucceeded) {
|
|
547
566
|
throw new Error(`Deployment failed: ${deployErr}`);
|
|
548
567
|
}
|
|
568
|
+
if (isLocaleError) {
|
|
569
|
+
await this.logger.debug("Ignoring SF CLI locale message error - deployment appears successful");
|
|
570
|
+
}
|
|
549
571
|
await this.logger.info("Successfully updated trigger status via SF CLI deployment", {
|
|
550
572
|
triggerCount: triggerNames.length,
|
|
551
573
|
status
|
package/package.json
CHANGED