diff options
Diffstat (limited to 'lib/license/finder/ext/pipenv.rb')
| -rw-r--r-- | lib/license/finder/ext/pipenv.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/license/finder/ext/pipenv.rb b/lib/license/finder/ext/pipenv.rb index 075ddd9..d681cc2 100644 --- a/lib/license/finder/ext/pipenv.rb +++ b/lib/license/finder/ext/pipenv.rb @@ -5,8 +5,8 @@ module LicenseFinder def prepare return unless pipfile? - shell.execute([:pipenv, '--python', python.version]) - shell.execute([:pipenv, :run, :pipenv, :sync, '--pypi-mirror', python.pip_index_url]) + shell.execute([:pipenv, '--python', python.version], env: default_env) + shell.execute([:pipenv, :run, :pipenv, :sync, '--pypi-mirror', python.pip_index_url], env: default_env) end def current_packages @@ -17,10 +17,6 @@ module LicenseFinder private - def shell - @shell ||= ::License::Management::Shell.new - end - def python @python ||= ::License::Management::Python.new end @@ -52,5 +48,12 @@ module LicenseFinder def lockfile_hash @lockfile_hash ||= JSON.parse(IO.read(detected_package_path)) end + + def default_env + return {} unless shell.custom_certificate_installed? + return {} if ENV['PIP_CERT'] + + { 'PIP_CERT' => shell.custom_certificate_path.to_s } + end end end |
