summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/license/management/tool_box.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/license/management/tool_box.rb b/lib/license/management/tool_box.rb
index 9362b5b..0e39a61 100644
--- a/lib/license/management/tool_box.rb
+++ b/lib/license/management/tool_box.rb
@@ -3,6 +3,8 @@
module License
module Management
class ToolBox
+ C_BASED_TOOLS = [:php, :python, :ruby].freeze
+
attr_reader :project_path, :shell
def initialize(shell, project_path)
@@ -15,18 +17,22 @@ module License
deb = deb_for(tool, version)
if deb&.exist?
shell.execute([:dpkg, '-i', deb])
- elsif tool == :nodejs
- shell.execute(['/opt/asdf/plugins/nodejs/bin/import-release-team-keyring'])
+ else
+ shell.execute([:asdf, "plugin-update", tool.to_s], env: env)
+ shell.execute(['/opt/asdf/plugins/nodejs/bin/import-release-team-keyring']) if tool == :nodejs
end
- shell.execute([:asdf, "plugin-update", tool.to_s], env: env)
shell.execute([:asdf, :install, tool.to_s, version], env: env)
shell.execute([:asdf, :local, tool.to_s, version], env: env)
shell.execute([:asdf, :reshim], env: env)
end
-
+ install_common_libraries(env: env) if C_BASED_TOOLS.include?(tool.to_sym)
install_certificates_into_java_keystore(env) if tool == :java
end
+ def install_common_libraries(env: {})
+ shell.execute(['apt-get', 'install', '-y', '-f', '--no-install-recommends', '/opt/toolcache/common/*.deb'], env: env)
+ end
+
def version_of(tool, env: ENV)
Dir.chdir(project_path) do
case tool