Skip to content

Commit 8f93730

Browse files
Update src/handlers/filesystem-handlers.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent ef9dbbc commit 8f93730

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/handlers/filesystem-handlers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,9 @@ export async function handleWritePdf(args: unknown): Promise<ServerResult> {
315315
try {
316316
const parsed = WritePdfArgsSchema.parse(args);
317317
await writePdf(parsed.path, parsed.content, parsed.outputPath, parsed.options);
318+
const targetPath = parsed.outputPath || parsed.path;
318319
return {
319-
content: [{ type: "text", text: `Successfully wrote PDF to ${parsed.outputPath}.\n Original file: ${parsed.path}` }],
320+
content: [{ type: "text", text: `Successfully wrote PDF to ${targetPath}${parsed.outputPath ? `\nOriginal file: ${parsed.path}` : ''}` }],
320321
};
321322
} catch (error) {
322323
const errorMessage = error instanceof Error ? error.message : String(error);

0 commit comments

Comments
 (0)