Skip to content

Commit

Permalink
minor: just returns on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Mar 13, 2019
1 parent 670ed39 commit 1232756
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
5 changes: 1 addition & 4 deletions package.json
Expand Up @@ -4,9 +4,6 @@
"version": "0.0.0-development",
"author": "Zach Bloomquist <zach@cypress.io>",
"bugs": "https://github.com/cypress-io/get-windows-proxy/issues",
"os": [
"win32"
],
"config": {
"pre-git": {
"commit-msg": "simple",
Expand Down Expand Up @@ -83,7 +80,7 @@
"sinon": "7.2.5"
},
"dependencies": {
"@cypress/registry-js": "1.3.2-patch27",
"@cypress/registry-js": "1.3.2-patch29",
"debug": "4.1.1"
}
}
5 changes: 5 additions & 0 deletions src/get-windows-proxy-spec.js
@@ -1,11 +1,16 @@
const { expect } = require('chai')
const os = require('os')
const registry = require('@cypress/registry-js')
const sinon = require('sinon')

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

context('getWindowsProxy', () => {
beforeEach(() => {
sinon.stub(os, 'platform').returns('win32')
})

afterEach(() => {
sinon.restore()
})
Expand Down
15 changes: 3 additions & 12 deletions src/index.js
@@ -1,15 +1,6 @@
const debug = require('debug')('get-windows-proxy')
let registry

try {
registry = require('@cypress/registry-js')
} catch (err) {
if (err.code !== 'MODULE_NOT_FOUND') {
throw err
}

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.')
}
const os = require('os')
const registry = require('@cypress/registry-js')

const findByName = (values, name) => {
return values.find((value) => {
Expand All @@ -18,7 +9,7 @@ const findByName = (values, name) => {
}

module.exports = function getWindowsProxy () {
if (!registry) {
if (!registry || os.platform() !== 'win32') {
return
}

Expand Down

0 comments on commit 1232756

Please sign in to comment.