Skip to content

Commit

Permalink
fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
FranciscoMoretti committed Jul 24, 2024
1 parent f632bbe commit df9de34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/cli/src/pull.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export type DocuNotionOptions = {

let layoutStrategy: LayoutStrategy
let notionToMarkdown: NotionToMarkdown
const pages = new Array<NotionPage>()

const counts = {
output_normally: 0,
Expand Down Expand Up @@ -149,14 +148,16 @@ export async function notionPull(options: DocuNotionOptions): Promise<void> {

info(`PULL: Fetched entire page tree`)

const pages = new Array<NotionPage>()
// ---- Markdown conversion and writing to files ----
await getPagesRecursively(
options,
"",
rootPageUUID,
0,
true,
cachedNotionClient
cachedNotionClient,
pages
)

await saveDataToJson(objectsTree, CACHE_DIR + "object_tree.json")
Expand Down Expand Up @@ -251,7 +252,8 @@ async function getPagesRecursively(
pageIdOfThisParent: string,
orderOfThisParent: number,
rootLevel: boolean,
client: Client
client: Client,
pages: Array<NotionPage>
) {
const pageInTheOutline = await fromPageId(
incomingContext,
Expand Down Expand Up @@ -314,7 +316,8 @@ async function getPagesRecursively(
childPageInfo.id,
childPageInfo.order,
false,
client
client,
pages
)
}

Expand Down
1 change: 1 addition & 0 deletions packages/notion-downloader/src/fetch-notion-object-tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export async function downloadObjectTree({
})

await client.saveCache()
return objectsTree
}

export async function fetchNotionObjectTree({
Expand Down

0 comments on commit df9de34

Please sign in to comment.