feat: .husky & format

This commit is contained in:
ningmengchongshui 2024-06-08 21:09:19 +08:00
parent 37712f726a
commit a0f71e8730
2 changed files with 51 additions and 29 deletions

View File

@ -1,2 +1,21 @@
# Node dependencies
node_modules
# 旧版文件夹
config
docker
lib
plugins
renderers
# 旧版文件
CHANGELOG.md
docker-compose.yaml
miao.js
# 缓存目录
data
trss.js

View File

@ -7,11 +7,8 @@ let skipDownload = false
let executablePath
if (process.platform === 'linux' || process.platform === 'android')
for (const item of [
"chromium",
"chromium-browser",
"chrome",
]) try {
for (const item of ['chromium', 'chromium-browser', 'chrome'])
try {
const chromiumPath = execSync(`command -v ${item}`).toString().trim()
if (chromiumPath && existsSync(chromiumPath)) {
executablePath = chromiumPath
@ -20,27 +17,33 @@ if (process.platform === 'linux' || process.platform === 'android')
} catch (err) {}
// macOS
if (process.platform === 'darwin') for (const item of [
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)) {
'/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge'
])
if (existsSync(item)) {
executablePath = item
break
}
}
if (!executablePath) for (const item of [
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)) {
'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
}