We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3045301 commit 77d0371Copy full SHA for 77d0371
index.ts
@@ -23,10 +23,10 @@ export const fetchGoogleDocsFiles = async (files: string[]) => {
23
documentId: documentId.split(":")[0],
24
auth: oauth2Client,
25
});
26
- if (!result.data.title) throw new Error("Title not found");
27
const title = documentId.includes(":")
28
? documentId.split(":")[1]
29
: `${result.data.title}.md`;
+ if (!title) throw new Error("Title not found");
30
await fs.writeFile(join(".", title), googleDocsToMarkdown(result.data));
31
console.log("Downloaded document", result.data.title);
32
} catch (error) {
0 commit comments