Skip to content

Commit

Permalink
feat(deploy): add a markdown output for deployment failure for a package
Browse files Browse the repository at this point in the history
  • Loading branch information
azlam-abdulsalam committed Sep 1, 2023
1 parent 8ecad97 commit 70093e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/sfpowerscripts-cli/src/impl/deploy/DeployImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,13 @@ export default class DeployImpl {
result: PackageInstallationStatus.Failed,
message: error,
};


FileOutputHandler.getInstance().writeOutput(`deployment-error.md`,`### 💣 Deployment Failed 💣`);
FileOutputHandler.getInstance().appendOutput(`deployment-error.md`,`Package Installation failed for **${queue[i].packageName}**`);
FileOutputHandler.getInstance().appendOutput(`deployment-error.md`,`Reasons:`);
FileOutputHandler.getInstance().appendOutput(`deployment-error.md`,`${error}`);

return failedPackageInstallationResult;
}
}
Expand Down
2 changes: 2 additions & 0 deletions packages/sfpowerscripts-cli/src/outputs/FileOutputHandler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as fs from 'fs-extra';
import { EOL } from 'os';
import path from 'path';

export default class FileOutputHandler {
Expand Down Expand Up @@ -27,6 +28,7 @@ export default class FileOutputHandler {
if (!fs.existsSync(path.join(this.containerFolder, fileName))) {
fs.createFileSync(path.join(this.containerFolder, fileName));
}
fs.appendFileSync(path.join(this.containerFolder, fileName), EOL);
fs.appendFileSync(path.join(this.containerFolder, fileName), output);
}

Expand Down

0 comments on commit 70093e5

Please sign in to comment.