From a0f71e8730d760bdc151343bc5f3eda603017a67 Mon Sep 17 00:00:00 2001 From: ningmengchongshui <916415899@qq.com> Date: Sat, 8 Jun 2024 21:09:19 +0800 Subject: [PATCH] feat: .husky & format --- .prettierignore | 19 +++++++++++++++ .puppeteerrc.cjs | 61 +++++++++++++++++++++++++----------------------- 2 files changed, 51 insertions(+), 29 deletions(-) diff --git a/.prettierignore b/.prettierignore index 5d31392..1e06f34 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,21 @@ # Node dependencies node_modules + + +# 旧版文件夹 +config +docker +lib +plugins +renderers + +# 旧版文件 + +CHANGELOG.md +docker-compose.yaml +miao.js + + +# 缓存目录 +data +trss.js \ No newline at end of file diff --git a/.puppeteerrc.cjs b/.puppeteerrc.cjs index 988a079..7bd7c8d 100644 --- a/.puppeteerrc.cjs +++ b/.puppeteerrc.cjs @@ -7,40 +7,43 @@ let skipDownload = false let executablePath if (process.platform === 'linux' || process.platform === 'android') - for (const item of [ - "chromium", - "chromium-browser", - "chrome", - ]) try { - const chromiumPath = execSync(`command -v ${item}`).toString().trim() - if (chromiumPath && existsSync(chromiumPath)) { - executablePath = chromiumPath - break - } - } catch (err) {} + for (const item of ['chromium', 'chromium-browser', 'chrome']) + try { + const chromiumPath = execSync(`command -v ${item}`).toString().trim() + if (chromiumPath && existsSync(chromiumPath)) { + executablePath = chromiumPath + break + } + } catch (err) {} // macOS -if (process.platform === 'darwin') for (const item of [ - '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', - '/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge', -]) if (existsSync(item)) { - executablePath = item - break -} +if (process.platform === 'darwin') + for (const item of [ + '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', + '/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge' + ]) + if (existsSync(item)) { + executablePath = item + break + } -if (!executablePath) for (const item of [ - '/usr/bin/chromium', - '/usr/bin/chromium-browser', - '/usr/bin/chrome', - 'C:/Program Files/Google/Chrome/Application/chrome.exe', - 'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe', -]) if (existsSync(item)) { - executablePath = item - break -} +if (!executablePath) + for (const item of [ + '/usr/bin/chromium', + '/usr/bin/chromium-browser', + '/usr/bin/chrome', + 'C:/Program Files/Google/Chrome/Application/chrome.exe', + 'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe' + ]) + if (existsSync(item)) { + executablePath = item + break + } if (executablePath || arch === 'arm64' || arch === 'aarch64') { - (typeof logger == 'object' ? logger : console).info(`[Chromium] ${executablePath}`) + ;(typeof logger == 'object' ? logger : console).info( + `[Chromium] ${executablePath}` + ) skipDownload = true }