diff options
Diffstat (limited to 'lib/license')
| -rw-r--r-- | lib/license/finder/ext/npm.rb | 8 | ||||
| -rw-r--r-- | lib/license/management/shell.rb | 9 | ||||
| -rw-r--r-- | lib/license/management/version.rb | 2 |
3 files changed, 15 insertions, 4 deletions
diff --git a/lib/license/finder/ext/npm.rb b/lib/license/finder/ext/npm.rb index 75c0855..48741f9 100644 --- a/lib/license/finder/ext/npm.rb +++ b/lib/license/finder/ext/npm.rb @@ -16,7 +16,7 @@ module LicenseFinder def prepare Dir.chdir(project_path) do - shell.execute("#{prepare_command} --production") + shell.execute("#{prepare_command} --production", env: default_env) end end @@ -32,5 +32,11 @@ module LicenseFinder end status.success? ? JSON.parse(stdout) : {} 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 diff --git a/lib/license/management/shell.rb b/lib/license/management/shell.rb index 9ff59c4..9053a3f 100644 --- a/lib/license/management/shell.rb +++ b/lib/license/management/shell.rb @@ -48,6 +48,7 @@ module License Dir.glob('custom.*.crt').each do |path| full_path = File.expand_path(path) execute([:openssl, :x509, '-in', full_path, '-text', '-noout']) + keystore_path = "#{ENV['JAVA_HOME']}/jre/lib/security/cacerts" execute([ :keytool, '-importcert', @@ -56,9 +57,13 @@ module License '-trustcacerts', '-noprompt', '-storepass', 'changeit', - '-keystore', "#{ENV['JAVA_HOME']}/jre/lib/security/cacerts" + '-keystore', keystore_path + ]) + execute([ + :keytool, '-list', '-v', + '-storepass changeit', + '-keystore', keystore_path ]) - execute(["keytool -list -v -storepass changeit"]) end end end diff --git a/lib/license/management/version.rb b/lib/license/management/version.rb index cfb570e..881fa37 100644 --- a/lib/license/management/version.rb +++ b/lib/license/management/version.rb @@ -2,6 +2,6 @@ module License module Management - VERSION = '3.7.6' + VERSION = '3.8.0' end end |
