Skip to content

Commit 1232756

Browse files
committed
minor: just returns on linux
1 parent 670ed39 commit 1232756

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
"version": "0.0.0-development",
55
"author": "Zach Bloomquist <[email protected]>",
66
"bugs": "https://github.com/cypress-io/get-windows-proxy/issues",
7-
"os": [
8-
"win32"
9-
],
107
"config": {
118
"pre-git": {
129
"commit-msg": "simple",
@@ -83,7 +80,7 @@
8380
"sinon": "7.2.5"
8481
},
8582
"dependencies": {
86-
"@cypress/registry-js": "1.3.2-patch27",
83+
"@cypress/registry-js": "1.3.2-patch29",
8784
"debug": "4.1.1"
8885
}
8986
}

src/get-windows-proxy-spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
const { expect } = require('chai')
2+
const os = require('os')
23
const registry = require('@cypress/registry-js')
34
const sinon = require('sinon')
45

56
/* eslint-env mocha */
67
const getWindowsProxy = require('.')
78

89
context('getWindowsProxy', () => {
10+
beforeEach(() => {
11+
sinon.stub(os, 'platform').returns('win32')
12+
})
13+
914
afterEach(() => {
1015
sinon.restore()
1116
})

src/index.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
const debug = require('debug')('get-windows-proxy')
2-
let registry
3-
4-
try {
5-
registry = require('@cypress/registry-js')
6-
} catch (err) {
7-
if (err.code !== 'MODULE_NOT_FOUND') {
8-
throw err
9-
}
10-
11-
debug('Could not load native extension for Windows registry access. The most likely reason is that your Node version has changed since installing. Try re-installing get-windows-proxy.')
12-
}
2+
const os = require('os')
3+
const registry = require('@cypress/registry-js')
134

145
const findByName = (values, name) => {
156
return values.find((value) => {
@@ -18,7 +9,7 @@ const findByName = (values, name) => {
189
}
1910

2011
module.exports = function getWindowsProxy () {
21-
if (!registry) {
12+
if (!registry || os.platform() !== 'win32') {
2213
return
2314
}
2415

0 commit comments

Comments
 (0)