vouchington-tooling 0.13.0 → 0.13.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vouchington-tooling",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "Vouchington CLI and extractable tooling libraries.",
|
|
5
5
|
"homepage": "https://github.com/vouchington/vouchington-tooling/tree/main/packages/vouchington-tooling#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -25,16 +25,47 @@ browser_revision() {
|
|
|
25
25
|
node -e "const fs=require('node:fs'); const file=process.argv[1]; const name=process.argv[2]; const browser=JSON.parse(fs.readFileSync(file,'utf8')).browsers.find(b => b.name === name); if (!browser) { process.stderr.write('unknown browser '+name); process.exit(1) } process.stdout.write(String(browser.revision))" "$browsers_json" "$1"
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
browser_executable() {
|
|
29
|
+
local name="$1" dir="$2" exe
|
|
30
|
+
case "$name" in
|
|
31
|
+
chromium) exe="$dir/chrome-linux-arm64/chrome" ;;
|
|
32
|
+
chromium-headless-shell) exe="$dir/chrome-headless-shell-linux-arm64/chrome-headless-shell" ;;
|
|
33
|
+
*)
|
|
34
|
+
echo "::error::browser_executable: unknown browser name '$name'" >&2
|
|
35
|
+
return 2
|
|
36
|
+
;;
|
|
37
|
+
esac
|
|
38
|
+
if [ -x "$exe" ]; then
|
|
39
|
+
printf '%s\n' "$exe"
|
|
40
|
+
return
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
# Playwright releases before 1.63 used these archive layouts.
|
|
44
|
+
case "$name" in
|
|
45
|
+
chromium) exe="$dir/chrome-linux/chrome" ;;
|
|
46
|
+
chromium-headless-shell) exe="$dir/chrome-linux/headless_shell" ;;
|
|
47
|
+
esac
|
|
48
|
+
if [ -x "$exe" ]; then
|
|
49
|
+
printf '%s\n' "$exe"
|
|
50
|
+
return
|
|
51
|
+
fi
|
|
52
|
+
return 1
|
|
53
|
+
}
|
|
54
|
+
|
|
28
55
|
install_browser() {
|
|
29
56
|
local name="$1" archive="$2"
|
|
30
57
|
local rev
|
|
31
58
|
rev=$(browser_revision "$name")
|
|
32
59
|
local dir="${browsers_path}/${name//-/_}-${rev}"
|
|
33
60
|
local marker="${dir}/INSTALLATION_COMPLETE"
|
|
61
|
+
local exe
|
|
34
62
|
|
|
35
63
|
if [ -f "$marker" ]; then
|
|
36
|
-
|
|
37
|
-
|
|
64
|
+
if exe=$(browser_executable "$name" "$dir"); then
|
|
65
|
+
echo "Already installed: ${name}-${rev} (cache hit)"
|
|
66
|
+
return
|
|
67
|
+
fi
|
|
68
|
+
echo "Reinstalling ${name}-${rev}: cache marker exists but executable is missing"
|
|
38
69
|
fi
|
|
39
70
|
|
|
40
71
|
echo "Installing ${name} v${rev} via curl + system unzip"
|
|
@@ -47,17 +78,8 @@ install_browser() {
|
|
|
47
78
|
unzip -q "$tmp" -d "$dir"
|
|
48
79
|
rm -f "$tmp"
|
|
49
80
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
chromium) exe="$dir/chrome-linux/chrome" ;;
|
|
53
|
-
chromium-headless-shell) exe="$dir/chrome-linux/headless_shell" ;;
|
|
54
|
-
*)
|
|
55
|
-
echo "::error::install_browser: unknown browser name '$name'"
|
|
56
|
-
exit 1
|
|
57
|
-
;;
|
|
58
|
-
esac
|
|
59
|
-
if [ ! -x "$exe" ]; then
|
|
60
|
-
echo "::error::Expected ${name} binary missing or not executable after extract: $exe"
|
|
81
|
+
if ! exe=$(browser_executable "$name" "$dir"); then
|
|
82
|
+
echo "::error::Expected ${name} binary missing or not executable after extract: $dir"
|
|
61
83
|
exit 1
|
|
62
84
|
fi
|
|
63
85
|
|