saucectl 0.73.1 → 0.77.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/README.md CHANGED
@@ -27,6 +27,14 @@ saucectl version 0.4.0
27
27
 
28
28
  __Note:__ if you run the command for the first time it will initially download the binary for you. This only happens once.
29
29
 
30
+ ### Install binary from Mirror
31
+
32
+ Use the `SAUCECTL_INSTALL_BINARY_MIRROR` env to override the default download base site (https://github.com/saucelabs/saucectl/releases/download)
33
+
34
+ ```bash
35
+ SAUCECTL_INSTALL_BINARY_MIRROR=https://your-mirror-download-site.com/foo/bar npm i -g saucectl
36
+ ```
37
+
30
38
  ---
31
39
 
32
40
  For more information to `saucectl`, visit its main repository: [saucelabs/saucectl](https://github.com/saucelabs/saucectl).
package/index.js CHANGED
@@ -3,14 +3,15 @@ const { spawn } = require('child_process');
3
3
  const path = require('path');
4
4
  const BinWrapper = require('bin-wrapper');
5
5
 
6
- const version = '0.73.1'
7
- const base = 'https://github.com/saucelabs/saucectl/releases/download';
8
- const binWrapper = (binInstallURL = null) => {
6
+ const version = '0.77.0'
7
+ const defaultBinInstallBase = 'https://github.com/saucelabs/saucectl/releases/download';
8
+ const binWrapper = (binInstallURL = null, binInstallBase = null) => {
9
9
  const bw = new BinWrapper();
10
10
 
11
11
  if (binInstallURL) {
12
12
  bw.src(binInstallURL, '', '')
13
13
  } else {
14
+ const base = binInstallBase || defaultBinInstallBase;
14
15
  bw.src(`${base}/v${version}/saucectl_${version}_mac_32-bit.tar.gz`, 'darwin', 'x86')
15
16
  .src(`${base}/v${version}/saucectl_${version}_mac_64-bit.tar.gz`, 'darwin', 'x64')
16
17
  .src(`${base}/v${version}/saucectl_${version}_linux_32-bit.tar.gz`, 'linux', 'x86')
@@ -42,7 +43,7 @@ async function main (b, args) {
42
43
 
43
44
  /* istanbul ignore if */
44
45
  if (require.main === module) {
45
- const bw = binWrapper(process.env.SAUCECTL_INSTALL_BINARY);
46
+ const bw = binWrapper(process.env.SAUCECTL_INSTALL_BINARY, process.env.SAUCECTL_INSTALL_BINARY_MIRROR);
46
47
  main(bw, process.argv.slice(2));
47
48
  }
48
49
 
package/install.js CHANGED
@@ -7,7 +7,7 @@ const { binWrapper } = require('./index.js');
7
7
  // execution.
8
8
  async function install () {
9
9
  console.info('Fetching saucectl binary');
10
- const bw = binWrapper(process.env.SAUCECTL_INSTALL_BINARY);
10
+ const bw = binWrapper(process.env.SAUCECTL_INSTALL_BINARY, process.env.SAUCECTL_INSTALL_BINARY_MIRROR);
11
11
  bw.run(['--version'])
12
12
  .then(() => {
13
13
  console.info(`Installation succeed`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saucectl",
3
- "version": "0.73.1",
3
+ "version": "0.77.0",
4
4
  "description": "Node.js wrapper for saucectl: Sauce Labs Testrunner Toolkit",
5
5
  "main": "index.js",
6
6
  "bin": "index.js",