diff options
| author | mo khan <mo.khan@gmail.com> | 2020-05-19 15:00:19 +0000 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-05-19 15:00:19 +0000 |
| commit | 7b8a9fce94fa4c457563ed150fae4d4043315265 (patch) | |
| tree | f6abd71ff61f23fde8f450014b3e309f6c71f30d /lib | |
| parent | f91ef2e9f1ac7c2a1fc2e71423b0f09ba89a63cd (diff) | |
| parent | e5890c3343aa38e3c66678f76b089710826b6162 (diff) | |
Merge branch '212922-yarn-custom-registry' into 'master'v3.9.0
Pull yarn packages from a custom registry
See merge request gitlab-org/security-products/license-management!148
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 |
