@watchtowerobservability/cli 0.3.1 → 0.3.3

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.
Files changed (2) hide show
  1. package/install.js +3 -1
  2. package/package.json +6 -20
package/install.js CHANGED
@@ -13,7 +13,9 @@ async function get(url) {
13
13
  const name = assetName(process.platform, process.arch);
14
14
  if (!name) throw new Error(`unsupported platform ${process.platform}/${process.arch}`);
15
15
  const v = require('./package.json').version;
16
- const base = `https://github.com/watchtowerobservability/watchtower-cli/releases/download/v${v}`;
16
+ // WTCTL_DOWNLOAD_BASE: a mirror of the GitHub release assets, for runners that only reach npm.
17
+ const root = process.env.WTCTL_DOWNLOAD_BASE || 'https://github.com/watchtowerobservability/watchtower-cli/releases/download';
18
+ const base = `${root.replace(/\/+$/, '')}/v${v}`;
17
19
  const [bin, sums] = await Promise.all([get(`${base}/${name}`), get(`${base}/SHA256SUMS`)]);
18
20
  verify(bin, sums.toString(), name);
19
21
  const dest = path.join(__dirname, 'bin', process.platform === 'win32' ? 'wtctl-bin.exe' : 'wtctl-bin');
package/package.json CHANGED
@@ -1,26 +1,12 @@
1
1
  {
2
2
  "name": "@watchtowerobservability/cli",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Watchtower command line client (downloads and verifies the release binary)",
5
5
  "license": "Apache-2.0",
6
6
  "repository": "github:watchtowerobservability/watchtower-cli",
7
- "bin": {
8
- "wtctl": "bin/wtctl.js"
9
- },
10
- "scripts": {
11
- "postinstall": "node install.js",
12
- "test": "node --test test.js"
13
- },
14
- "files": [
15
- "bin",
16
- "install.js",
17
- "lib.js"
18
- ],
19
- "publishConfig": {
20
- "registry": "https://registry.npmjs.org/",
21
- "access": "public"
22
- },
23
- "engines": {
24
- "node": ">=20"
25
- }
7
+ "bin": { "wtctl": "bin/wtctl.js" },
8
+ "scripts": { "postinstall": "node install.js", "test": "node --test test.js" },
9
+ "files": ["bin", "install.js", "lib.js"],
10
+ "publishConfig": { "registry": "https://registry.npmjs.org/", "access": "public" },
11
+ "engines": { "node": ">=20" }
26
12
  }