fallow 2.81.0 → 2.82.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.
@@ -1,63 +0,0 @@
1
- const { getPlatformPackage } = require('./platform-package');
2
- const { verifyInstalled, SKIP_ENV } = require('./verify-binary');
3
-
4
- const pkg = (() => {
5
- if (process.platform !== 'linux') {
6
- return getPlatformPackage(process.platform, process.arch);
7
- }
8
-
9
- try {
10
- const { familySync } = require('detect-libc');
11
- return getPlatformPackage(process.platform, process.arch, familySync());
12
- } catch {
13
- return getPlatformPackage(process.platform, process.arch);
14
- }
15
- })();
16
-
17
- if (!pkg) {
18
- console.warn(
19
- `fallow: No prebuilt binary for ${process.platform}-${process.arch}. ` +
20
- `You can build from source: https://github.com/fallow-rs/fallow`
21
- );
22
- process.exit(0);
23
- }
24
-
25
- try {
26
- require.resolve(`${pkg}/package.json`);
27
- } catch {
28
- console.warn(
29
- `fallow: Platform package ${pkg} not installed. ` +
30
- `This may happen if you used --no-optional. ` +
31
- `Run 'npm install' to fix.`
32
- );
33
- // Without the platform package there is nothing to verify; keep the existing
34
- // soft-fail behavior for --no-optional installs.
35
- process.exit(0);
36
- }
37
-
38
- async function main() {
39
- const result = await verifyInstalled();
40
- if (result.skipped) {
41
- console.warn(
42
- `fallow: binary verification skipped (${SKIP_ENV}=${process.env[SKIP_ENV]}). ` +
43
- `Only set this when you are deliberately replacing the published binary. ` +
44
- `See https://github.com/fallow-rs/fallow/blob/main/SECURITY.md for details.`
45
- );
46
- process.exit(0);
47
- }
48
- if (!result.ok) {
49
- const where = result.binary ? ` ${result.binary}` : '';
50
- console.error(
51
- `fallow: binary verification failed${where} (${result.code}): ${result.message}. ` +
52
- `This usually means the published platform package was tampered with. ` +
53
- `See https://github.com/fallow-rs/fallow/blob/main/SECURITY.md for details. ` +
54
- `Set ${SKIP_ENV}=1 only if you are deliberately replacing the binary.`
55
- );
56
- process.exit(1);
57
- }
58
- }
59
-
60
- main().catch((err) => {
61
- console.error(`fallow: binary verification failed (internal-error): ${err.message}`);
62
- process.exit(1);
63
- });