@jfrog-boost/boost 0.10.5 → 0.11.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/package.json +11 -7
- package/scripts/postinstall.js +62 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jfrog-boost/boost",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Boost CLI — compress agent/CI tool output (prebuilt binary wrapper)",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://boost.jfrog.com",
|
|
@@ -14,19 +14,23 @@
|
|
|
14
14
|
"bin": {
|
|
15
15
|
"boost": "bin/boost.js"
|
|
16
16
|
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"postinstall": "node scripts/postinstall.js"
|
|
19
|
+
},
|
|
17
20
|
"files": [
|
|
18
21
|
"bin/",
|
|
19
|
-
"lib/"
|
|
22
|
+
"lib/",
|
|
23
|
+
"scripts/"
|
|
20
24
|
],
|
|
21
25
|
"engines": {
|
|
22
26
|
"node": ">=18"
|
|
23
27
|
},
|
|
24
28
|
"optionalDependencies": {
|
|
25
|
-
"@jfrog-boost/boost-darwin-arm64": "0.
|
|
26
|
-
"@jfrog-boost/boost-darwin-x64": "0.
|
|
27
|
-
"@jfrog-boost/boost-linux-arm64": "0.
|
|
28
|
-
"@jfrog-boost/boost-linux-x64": "0.
|
|
29
|
-
"@jfrog-boost/boost-win32-x64": "0.
|
|
29
|
+
"@jfrog-boost/boost-darwin-arm64": "0.11.0",
|
|
30
|
+
"@jfrog-boost/boost-darwin-x64": "0.11.0",
|
|
31
|
+
"@jfrog-boost/boost-linux-arm64": "0.11.0",
|
|
32
|
+
"@jfrog-boost/boost-linux-x64": "0.11.0",
|
|
33
|
+
"@jfrog-boost/boost-win32-x64": "0.11.0"
|
|
30
34
|
},
|
|
31
35
|
"keywords": [
|
|
32
36
|
"boost",
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* After a global `npm i -g @jfrog-boost/boost`, run `boost init` so the terms
|
|
6
|
+
* prompt and agent integrations match the shell installer path.
|
|
7
|
+
*
|
|
8
|
+
* Skips (exit 0) when:
|
|
9
|
+
* - not a global install (local dependency)
|
|
10
|
+
* - CI / non-TTY (cannot prompt)
|
|
11
|
+
* - BOOST_SKIP_INIT is set
|
|
12
|
+
* - the platform binary is missing
|
|
13
|
+
*
|
|
14
|
+
* Never fails the npm install: init errors print a hint and exit 0.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const { spawnSync } = require('child_process');
|
|
18
|
+
const { resolveBinaryPath } = require('../lib/platform');
|
|
19
|
+
|
|
20
|
+
function skipReason() {
|
|
21
|
+
if (process.env.BOOST_SKIP_INIT === '1' || process.env.BOOST_SKIP_INIT === 'true') {
|
|
22
|
+
return 'BOOST_SKIP_INIT';
|
|
23
|
+
}
|
|
24
|
+
// npm sets npm_config_global=true for `npm i -g`.
|
|
25
|
+
if (process.env.npm_config_global !== 'true') {
|
|
26
|
+
return 'local install';
|
|
27
|
+
}
|
|
28
|
+
if (process.env.CI === 'true' || process.env.CI === '1') {
|
|
29
|
+
return 'CI';
|
|
30
|
+
}
|
|
31
|
+
// Match boost's isTTY(): prompts need a real terminal on stderr.
|
|
32
|
+
if (!process.stderr.isTTY) {
|
|
33
|
+
return 'non-TTY';
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const reason = skipReason();
|
|
39
|
+
if (reason) {
|
|
40
|
+
console.log(`→ Skipping boost init (${reason}). Run \`boost init\` when ready.`);
|
|
41
|
+
process.exit(0);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
let bin;
|
|
45
|
+
try {
|
|
46
|
+
bin = resolveBinaryPath();
|
|
47
|
+
} catch (err) {
|
|
48
|
+
console.warn(`→ Skipping boost init: ${err.message || err}`);
|
|
49
|
+
process.exit(0);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
console.log('→ Running boost init…');
|
|
53
|
+
const result = spawnSync(bin, ['init'], { stdio: 'inherit' });
|
|
54
|
+
if (result.error) {
|
|
55
|
+
console.warn(`→ boost init failed to start: ${result.error.message || result.error}`);
|
|
56
|
+
console.warn(' Run `boost init` manually when ready.');
|
|
57
|
+
process.exit(0);
|
|
58
|
+
}
|
|
59
|
+
if (result.status !== 0) {
|
|
60
|
+
console.warn('→ boost init exited non-zero; run `boost init` manually when ready.');
|
|
61
|
+
}
|
|
62
|
+
process.exit(0);
|