saucectl 0.120.0 → 0.120.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +14 -7
  2. package/package.json +5 -4
package/index.js CHANGED
@@ -1,13 +1,21 @@
1
1
  #!/usr/bin/env node
2
2
  const { spawn } = require('child_process');
3
3
  const path = require('path');
4
- const BinWrapper = require('bin-wrapper');
4
+ const { BinWrapper } = require('@saucelabs/bin-wrapper');
5
5
 
6
- const version = '0.120.0'
6
+ const version = '0.120.1'
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
+ if (process.env.GITHUB_TOKEN) {
12
+ bw.httpOptions({
13
+ headers: {
14
+ authorization: `Bearer ${process.env.GITHUB_TOKEN}`,
15
+ }
16
+ });
17
+ }
18
+
11
19
  const base = binInstallBase || defaultBinInstallBase;
12
20
 
13
21
  let sources = [
@@ -23,18 +31,17 @@ const binWrapper = (binInstallURL = null, binInstallBase = null) => {
23
31
  sources = sources.filter(x => process.platform === x.os && process.arch === x.arch);
24
32
 
25
33
  if (binInstallURL) {
26
- bw.src(binInstallURL, '', '')
34
+ bw.src(binInstallURL, process.platform, process.arch);
27
35
  } else {
28
36
  if (sources.length === 0) {
29
37
  return Promise.reject(new Error(`No binary found matching your system. It's probably not supported.`));
30
38
  }
31
39
 
32
- bw.src(sources[0].url, '', '')
33
- .version(`v${version}`);
40
+ bw.src(sources[0].url, process.platform, process.arch);
34
41
  }
35
42
 
36
- bw.dest(path.join(__dirname, 'bin'))
37
- .use(process.platform.startsWith('win') ? 'saucectl.exe' : 'saucectl');
43
+ bw.dest(path.join(__dirname, 'bin'));
44
+ bw.use(process.platform.startsWith('win') ? 'saucectl.exe' : 'saucectl');
38
45
 
39
46
  return bw;
40
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saucectl",
3
- "version": "0.120.0",
3
+ "version": "0.120.1",
4
4
  "description": "Node.js wrapper for saucectl",
5
5
  "main": "index.js",
6
6
  "bin": "index.js",
@@ -36,16 +36,17 @@
36
36
  },
37
37
  "homepage": "https://github.com/saucelabs/node-saucectl#readme",
38
38
  "dependencies": {
39
- "bin-wrapper": "^4.1.0"
39
+ "@saucelabs/bin-wrapper": "~0.2.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "eslint": "^6.8.0",
43
43
  "eslint-plugin-jest": "^23.9.0",
44
44
  "eslint-plugin-node": "^11.1.0",
45
- "jest": "^26.0.1",
45
+ "jest": "^29.3.1",
46
46
  "np": "^6.2.3",
47
47
  "npm-run-all": "^4.1.5",
48
48
  "replace-in-files-cli": "^0.3.1",
49
- "rimraf": "^3.0.2"
49
+ "rimraf": "^3.0.2",
50
+ "ts-jest": "^29.0.5"
50
51
  }
51
52
  }