diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/license/finder/ext/yarn.rb | 8 |
1 files changed, 7 insertions, 1 deletions
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 |
