feat: .husky & format
This commit is contained in:
parent
37712f726a
commit
a0f71e8730
|
@ -1,2 +1,21 @@
|
|||
# Node dependencies
|
||||
node_modules
|
||||
|
||||
|
||||
# 旧版文件夹
|
||||
config
|
||||
docker
|
||||
lib
|
||||
plugins
|
||||
renderers
|
||||
|
||||
# 旧版文件
|
||||
|
||||
CHANGELOG.md
|
||||
docker-compose.yaml
|
||||
miao.js
|
||||
|
||||
|
||||
# 缓存目录
|
||||
data
|
||||
trss.js
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue