|
1 | 1 | import { readFileSync, readdirSync, statSync } from "fs"; |
2 | 2 | import path from "path"; |
3 | | -import puppeteer from "puppeteer"; |
4 | 3 | import { VERSION as currentVersion } from "./versions.js"; |
5 | 4 |
|
6 | 5 | export interface AuditI { |
@@ -99,31 +98,24 @@ const getPathDirectoryInDirectory = (startPath: string) => { |
99 | 98 | }; |
100 | 99 |
|
101 | 100 | const getChromePath = () => { |
102 | | - try { |
103 | | - return puppeteer.executablePath(); |
104 | | - } catch { |
105 | | - let chromeFilePath = path.join( |
106 | | - import.meta.dirname, |
107 | | - "../", |
108 | | - "chrome-headless-shell", |
109 | | - ); |
110 | | - if (process.env.NODE_ENV?.toString().trim() !== "development") { |
111 | | - chromeFilePath = path.join( |
112 | | - process.resourcesPath, |
113 | | - "chrome-headless-shell", |
114 | | - ); |
115 | | - } |
116 | | - |
117 | | - chromeFilePath = getPathDirectoryInDirectory(chromeFilePath); |
118 | | - chromeFilePath = getPathDirectoryInDirectory(chromeFilePath); |
119 | | - chromeFilePath = path.join(chromeFilePath, "chrome-headless-shell"); |
| 101 | + let chromeFilePath = path.join( |
| 102 | + import.meta.dirname, |
| 103 | + "../", |
| 104 | + "chrome-headless-shell", |
| 105 | + ); |
| 106 | + if (process.env.NODE_ENV?.toString().trim() !== "development") { |
| 107 | + chromeFilePath = path.join(process.resourcesPath, "chrome-headless-shell"); |
| 108 | + } |
120 | 109 |
|
121 | | - if (process.platform === "win32") { |
122 | | - chromeFilePath += ".exe"; |
123 | | - } |
| 110 | + chromeFilePath = getPathDirectoryInDirectory(chromeFilePath); |
| 111 | + chromeFilePath = getPathDirectoryInDirectory(chromeFilePath); |
| 112 | + chromeFilePath = path.join(chromeFilePath, "chrome-headless-shell"); |
124 | 113 |
|
125 | | - return chromeFilePath; |
| 114 | + if (process.platform === "win32") { |
| 115 | + chromeFilePath += ".exe"; |
126 | 116 | } |
| 117 | + |
| 118 | + return chromeFilePath; |
127 | 119 | }; |
128 | 120 |
|
129 | 121 | const checkNewerRelease = async () => { |
|
0 commit comments