fmt
This commit is contained in:
parent
6d7587580f
commit
31e99f2750
|
@ -21,6 +21,7 @@ ij_javascript_enforce_trailing_comma = keep
|
|||
ij_javascript_space_before_method_parentheses = true
|
||||
ij_javascript_spaces_within_object_literal_braces = true
|
||||
ij_javascript_indent_chained_calls = true
|
||||
ij_javascript_if_brace_force = if_multiline
|
||||
|
||||
[{*.json,*.json5}]
|
||||
ij_json_keep_trailing_comma = false
|
||||
|
|
|
@ -6,51 +6,37 @@ const arch = os.arch()
|
|||
let skipDownload = false
|
||||
let executablePath
|
||||
|
||||
// linux / android
|
||||
if (process.platform === 'linux' || process.platform === 'android') {
|
||||
if (process.platform === 'linux' || process.platform === 'android')
|
||||
for (const item of [
|
||||
"chromium",
|
||||
"chromium-browser",
|
||||
"chrome",
|
||||
]) {
|
||||
try {
|
||||
]) try {
|
||||
const chromiumPath = execSync(`command -v ${item}`).toString().trim()
|
||||
if (chromiumPath && existsSync(chromiumPath)) {
|
||||
executablePath = chromiumPath
|
||||
break
|
||||
}
|
||||
} catch (err) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} 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)) {
|
||||
]) if (existsSync(item)) {
|
||||
executablePath = item
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// windows 或其他
|
||||
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)) {
|
||||
]) if (existsSync(item)) {
|
||||
executablePath = item
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (executablePath || arch === 'arm64' || arch === 'aarch64') {
|
||||
|
|
Loading…
Reference in New Issue