gaunt-sloth-assistant
Version:
[](https://github.com/Galvanized-Pukeko/gaunt-sloth-assistant/actions/workflows/unit-tests.yml) [
* @param prId GitHub PR number
* @returns GitHub PR diff content or null if not found
*/
export async function get(_, prId) {
if (!prId) {
displayWarning('No GitHub PR number provided');
return null;
}
try {
// Use the GitHub CLI to fetch PR diff
const progress = new ProgressIndicator(`Fetching GitHub PR #${prId} diff`);
const prDiffContent = await execAsync(`gh pr diff ${prId}`);
progress.stop();
if (!prDiffContent) {
displayWarning(`No diff content found for GitHub PR #${prId}`);
return null;
}
return `GitHub PR Diff: #${prId}\n\n${prDiffContent}`;
}
catch (error) {
displayWarning(`
Failed to get GitHub PR diff #${prId}: ${error instanceof Error ? error.message : String(error)}
Consider checking if gh cli (https://cli.github.com/) is installed and authenticated.
`);
return null;
}
}
//# sourceMappingURL=ghPrDiffProvider.js.map