diff --git a/.editorconfig b/.editorconfig index 1b6e051..a80eb5a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -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 diff --git a/.puppeteerrc.cjs b/.puppeteerrc.cjs index 79228df..988a079 100644 --- a/.puppeteerrc.cjs +++ b/.puppeteerrc.cjs @@ -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 { - const chromiumPath = execSync(`command -v ${item}`).toString().trim() - if (chromiumPath && existsSync(chromiumPath)) { - executablePath = chromiumPath - break - } - } catch (err) { + ]) 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 } -// windows 或其他 -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') {