diff options
Diffstat (limited to 'lib/license/finder/ext')
| -rw-r--r-- | lib/license/finder/ext/bower.rb | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/lib/license/finder/ext/bower.rb b/lib/license/finder/ext/bower.rb index 2219b18..9b302f6 100644 --- a/lib/license/finder/ext/bower.rb +++ b/lib/license/finder/ext/bower.rb @@ -3,7 +3,15 @@ module LicenseFinder class Bower < PackageManager def prepare - shell.execute([:bower, :install, '--allow-root'], env: default_env) + shell.execute([ + :bower, + :install, + '--allow-root', + '--production', + '--verbose', + '--loglevel', + :debug + ], env: default_env) end def current_packages @@ -18,7 +26,7 @@ module LicenseFinder def bower_output stdout, _stderr, status = Dir.chdir(project_path) do - shell.execute([:bower, :list, '--json', '-l', 'action', '--allow-root']) + shell.execute([:bower, :list, '--json', '-l', 'action', '--allow-root'], env: default_env) end return {} unless status.success? @@ -48,12 +56,15 @@ module LicenseFinder end def default_env - return {} unless shell.custom_certificate_installed? - - { - 'NPM_CONFIG_CAFILE' => ENV.fetch('NPM_CONFIG_CAFILE', shell.custom_certificate_path.to_s), - 'bower_ca' => ENV.fetch('bower_ca', shell.custom_certificate_path.to_s) + @default_env ||= { + 'NPM_CONFIG_CAFILE' => ENV.fetch('NPM_CONFIG_CAFILE', shell.default_certificate_path).to_s, + 'bower_ca' => ENV.fetch('bower_ca', shell.default_certificate_path).to_s, + 'bower_directory' => ENV.fetch('bower_directory', vendor_path.join('bower_components')).to_s } end + + def vendor_path + Pathname.pwd.join('.gitlab', 'cache', 'vendor') + end end end |
