diff --git a/feishu-pages/src/feishu.ts b/feishu-pages/src/feishu.ts index b656312..0a9850e 100644 --- a/feishu-pages/src/feishu.ts +++ b/feishu-pages/src/feishu.ts @@ -32,6 +32,10 @@ export const TMP_DIR = path.resolve( * nested: /slug1/slug2/slug3 */ export const URL_STYLE = process.env.URL_STYLE || 'nested'; +/** + * Skip download assets, for debug speed up. + */ +export const SKIP_ASSETS = process.env.SKIP_ASSETS || false; const feishuConfig = { endpoint: process.env.FEISHU_ENDPOINT || 'https://open.feishu.cn', diff --git a/feishu-pages/src/index.ts b/feishu-pages/src/index.ts index 4f85c71..7237cd0 100644 --- a/feishu-pages/src/index.ts +++ b/feishu-pages/src/index.ts @@ -8,6 +8,7 @@ import { DOCS_DIR, OUTPUT_DIR, ROOT_NODE_TOKEN, + SKIP_ASSETS, feishuConfig, feishuDownload, fetchTenantAccessToken, @@ -143,6 +144,11 @@ const downloadFiles = async ( fileTokens: Record, docFolder: string ) => { + if (SKIP_ASSETS) { + console.info('skip assets download.'); + return content; + } + for (const fileToken in fileTokens) { const filePath = await feishuDownload( fileToken,