From 544f339dcf8f33178c32d872696138197f6c08e5 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Fri, 20 Nov 2020 09:13:08 +0100 Subject: [PATCH] Fix linking to bundled openpgp --- src/claims.js | 3 ++- src/keys.js | 3 ++- test/keys.test.js | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/claims.js b/src/claims.js index 814b96d..c47c2ab 100644 --- a/src/claims.js +++ b/src/claims.js @@ -13,9 +13,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +const path = require('path') const mergeOptions = require('merge-options') const validUrl = require('valid-url') -const openpgp = require('../node_modules/openpgp/dist/openpgp.min.js') +const openpgp = require(path.join(require.resolve('openpgp'), '..', 'openpgp.min.js')) const serviceproviders = require('./serviceproviders') const keys = require('./keys') const utils = require('./utils') diff --git a/src/keys.js b/src/keys.js index 6c9c311..5e1abec 100644 --- a/src/keys.js +++ b/src/keys.js @@ -13,10 +13,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +const path = require('path') const bent = require('bent') const req = bent('GET') const validUrl = require('valid-url') -const openpgp = require('../node_modules/openpgp/dist/openpgp.min.js') +const openpgp = require(path.join(require.resolve('openpgp'), '..', 'openpgp.min.js')) const mergeOptions = require('merge-options') const fetchHKP = async (identifier, keyserverBaseUrl) => { diff --git a/test/keys.test.js b/test/keys.test.js index 9baaf94..83426a6 100644 --- a/test/keys.test.js +++ b/test/keys.test.js @@ -16,7 +16,8 @@ limitations under the License. const chai = require('chai') const expect = chai.expect -const openpgp = require('../node_modules/openpgp/dist/openpgp.min.js') +const path = require('path') +const openpgp = require(path.join(require.resolve('openpgp'), '..', 'openpgp.min.js')) const doipjs = require('../src') const pubKeyFingerprint = `3637202523e7c1309ab79e99ef2dc5827b445f4b`