diff options
| author | mo khan <mo.khan@gmail.com> | 2020-05-14 10:56:08 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-05-15 09:35:22 -0600 |
| commit | ecc480c86f8bec8f1b9e58b7caefddedaf8dde12 (patch) | |
| tree | 38915817913a301b0675ff72385a50a7e7430043 /lib | |
| parent | f91ef2e9f1ac7c2a1fc2e71423b0f09ba89a63cd (diff) | |
Pull yarn packages from a custom registry
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 |
