diff options
| author | mo khan <mo.khan@gmail.com> | 2020-05-19 14:31:31 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-05-19 14:31:31 -0600 |
| commit | 92e06d9fc1303b790398362b9a039e8bba58cd4e (patch) | |
| tree | 4fcb063c095f5c898318efdbfa3a52e05e5726bd /lib | |
| parent | e2a538ed5c817c792299750ae24c7569b68cd9f3 (diff) | |
Fetch bower dependencies from custom repo with custom cert chain
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/license/finder/ext/bower.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/license/finder/ext/bower.rb b/lib/license/finder/ext/bower.rb index e53e532..ccfa7ee 100644 --- a/lib/license/finder/ext/bower.rb +++ b/lib/license/finder/ext/bower.rb @@ -3,13 +3,11 @@ module LicenseFinder class Bower < PackageManager def prepare - shell.execute([:bower, :install, '--allow-root']) + shell.execute([:bower, :install, '--allow-root'], env: default_env) end def current_packages - map_all(bower_output).flatten.compact.reject do |package| - package.name == 'bower' - end + map_all(bower_output).flatten.compact end def possible_package_paths @@ -46,5 +44,11 @@ module LicenseFinder install_path: bower_module['canonicalDir'] ) 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 |
