muagqa 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/muagqa-1.1.0.tgz +0 -0
- package/package.json +1 -1
- package/src/playwrightInstaller.js +9 -12
package/muagqa-1.1.0.tgz
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import { execSync } from "child_process";
|
|
2
2
|
import chalk from "chalk";
|
|
3
3
|
|
|
4
|
-
export function ensurePlaywrightInstalled() {
|
|
4
|
+
export async function ensurePlaywrightInstalled() {
|
|
5
5
|
try {
|
|
6
|
+
console.log(chalk.yellow("Checking Playwright installation..."));
|
|
7
|
+
|
|
6
8
|
execSync("npx playwright --version", { stdio: "ignore" });
|
|
7
|
-
return; // Already installed, nothing else to do
|
|
8
|
-
} catch (e) {
|
|
9
|
-
console.log(chalk.yellow("📦 Playwright not detected. Installing browsers..."));
|
|
10
|
-
}
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
throw err;
|
|
10
|
+
// If successful, browsers are already installed
|
|
11
|
+
return;
|
|
12
|
+
} catch {
|
|
13
|
+
console.log(chalk.cyan("\nPlaywright browsers not found. Installing...\n"));
|
|
14
|
+
execSync("npx playwright install chromium", { stdio: "inherit" });
|
|
18
15
|
}
|
|
19
|
-
}
|
|
16
|
+
}
|