saucectl 0.101.0 → 0.103.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.
Files changed (2) hide show
  1. package/index.js +20 -9
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -3,22 +3,33 @@ const { spawn } = require('child_process');
3
3
  const path = require('path');
4
4
  const BinWrapper = require('bin-wrapper');
5
5
 
6
- const version = '0.101.0'
6
+ const version = '0.103.0'
7
7
  const defaultBinInstallBase = 'https://github.com/saucelabs/saucectl/releases/download';
8
8
  const binWrapper = (binInstallURL = null, binInstallBase = null) => {
9
9
  const bw = new BinWrapper();
10
10
 
11
+ const base = binInstallBase || defaultBinInstallBase;
12
+
13
+ let sources = [
14
+ { url: `${base}/v${version}/saucectl_${version}_mac_64-bit.tar.gz`, os: 'darwin', arch: 'x64' },
15
+ { url: `${base}/v${version}/saucectl_${version}_mac_arm64.tar.gz`, os: 'darwin', arch: 'arm64' },
16
+ { url: `${base}/v${version}/saucectl_${version}_linux_32-bit.tar.gz`, os: 'linux', arch: 'x86' },
17
+ { url: `${base}/v${version}/saucectl_${version}_linux_64-bit.tar.gz`, os: 'linux', arch: 'x64' },
18
+ { url: `${base}/v${version}/saucectl_${version}_linux_arm64.tar.gz`, os: 'linux', arch: 'arm64' },
19
+ { url: `${base}/v${version}/saucectl_${version}_win_32-bit.zip`, os: 'win32', arch: 'x86' },
20
+ { url: `${base}/v${version}/saucectl_${version}_win_64-bit.zip`, os: 'win32', arch: 'x64' },
21
+ ];
22
+
23
+ sources = sources.filter(x => process.platform === x.os && process.arch === x.arch);
24
+
11
25
  if (binInstallURL) {
12
26
  bw.src(binInstallURL, '', '')
13
27
  } else {
14
- const base = binInstallBase || defaultBinInstallBase;
15
- bw.src(`${base}/v${version}/saucectl_${version}_mac_32-bit.tar.gz`, 'darwin', 'x86')
16
- .src(`${base}/v${version}/saucectl_${version}_mac_64-bit.tar.gz`, 'darwin', 'x64')
17
- .src(`${base}/v${version}/saucectl_${version}_linux_32-bit.tar.gz`, 'linux', 'x86')
18
- .src(`${base}/v${version}/saucectl_${version}_linux_64-bit.tar.gz`, 'linux', 'x64')
19
- .src(`${base}/v${version}/saucectl_${version}_win_32-bit.zip`, 'win32', 'x86')
20
- .src(`${base}/v${version}/saucectl_${version}_win_32-bit.zip`, 'win32', 'x64')
21
- .src(`${base}/v${version}/saucectl_${version}_win_64-bit.zip`, 'win64', 'x64')
28
+ if (sources.length === 0) {
29
+ return Promise.reject(new Error(`No binary found matching your system. It's probably not supported.`));
30
+ }
31
+
32
+ bw.src(sources[0].url, '', '')
22
33
  .version(`v${version}`);
23
34
  }
24
35
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "saucectl",
3
- "version": "0.101.0",
4
- "description": "Node.js wrapper for saucectl: Sauce Labs Testrunner Toolkit",
3
+ "version": "0.103.0",
4
+ "description": "Node.js wrapper for saucectl",
5
5
  "main": "index.js",
6
6
  "bin": "index.js",
7
7
  "scripts": {
@@ -29,7 +29,7 @@
29
29
  "e2e",
30
30
  "toolkit"
31
31
  ],
32
- "author": "Christian Broamnn <christian@saucelabs.com>",
32
+ "author": "devx <dev@saucelabs.com>",
33
33
  "license": "Apache-2.0",
34
34
  "bugs": {
35
35
  "url": "https://github.com/saucelabs/node-saucectl/issues"