Files
chromebrew/packages/sdkman.rb
2024-06-07 09:55:54 -04:00

26 lines
994 B
Ruby
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
require 'package'
class Sdkman < Package
description 'Software Development Kit Manager your reliable companion for effortlessly managing multiple Software Development Kits.'
homepage 'https://sdkman.io/'
version '5.18.2'
license 'Apache-2.0'
compatibility 'all'
source_url 'SKIP'
no_compile_needed
print_source_bashrc
def self.install
ENV['SDKMAN_DIR'] = "#{CREW_DEST_PREFIX}/share/sdkman"
system "curl -s https://get.sdkman.io | sed '419,425d' | bash"
system "sed -i 's,SDKMAN_DIR=\"\$HOME/\.sdkman\",SDKMAN_DIR=#{CREW_PREFIX}/share/sdkman,' #{CREW_DEST_PREFIX}/share/sdkman/bin/sdkman-init.sh"
FileUtils.install "#{CREW_DEST_PREFIX}/share/sdkman/contrib/completion/bash/sdk", "#{CREW_DEST_PREFIX}/etc/bash.d/sdkman-completion"
FileUtils.install "#{CREW_DEST_PREFIX}/share/sdkman/bin/sdkman-init.sh", "#{CREW_DEST_PREFIX}/etc/env.d/sdkman-init"
end
def self.postinstall
ExitMessage.add "\nType 'sdk' to get started.\n".lightblue
end
end