From ecc480c86f8bec8f1b9e58b7caefddedaf8dde12 Mon Sep 17 00:00:00 2001 From: mo khan Date: Thu, 14 May 2020 10:56:08 -0600 Subject: Pull yarn packages from a custom registry --- lib/license/finder/ext/yarn.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/license/finder/ext/yarn.rb b/lib/license/finder/ext/yarn.rb index dba096b..f9187ce 100644 --- a/lib/license/finder/ext/yarn.rb +++ b/lib/license/finder/ext/yarn.rb @@ -26,7 +26,7 @@ module LicenseFinder :yarn, :install, '--ignore-engines', '--ignore-scripts', '--production' - ]) + ], env: default_env) end end @@ -90,5 +90,11 @@ module LicenseFinder [YarnPackage.new(matches['name'], matches['version'], spec_licenses: ['unknown'])] end + + def default_env + return {} unless shell.custom_certificate_installed? + + { 'NPM_CONFIG_CAFILE' => ENV.fetch('NPM_CONFIG_CAFILE', shell.custom_certificate_path.to_s) } + end end end -- cgit v1.2.3