-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Restyled.io <[email protected]>
- Loading branch information
1 parent
9a58145
commit 1e63acd
Showing
2 changed files
with
22 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
# frozen_string_literal: true | ||
|
||
class Rtx < Formula | ||
desc 'Multi-language runtime manager' | ||
homepage 'https://github.com/jdx/rtx' | ||
license 'MIT' | ||
version '$RTX_VERSION' | ||
desc "Multi-language runtime manager" | ||
homepage "https://github.com/jdx/rtx" | ||
license "MIT" | ||
version "$RTX_VERSION" | ||
|
||
on_macos do | ||
if Hardware::CPU.intel? | ||
url 'https://rtx.pub/v$RTX_VERSION/rtx-v$RTX_VERSION-macos-x64.tar.xz' | ||
sha256 '$RTX_CHECKSUM_MACOS_X86_64' | ||
url "https://rtx.pub/v$RTX_VERSION/rtx-v$RTX_VERSION-macos-x64.tar.xz" | ||
sha256 "$RTX_CHECKSUM_MACOS_X86_64" | ||
end | ||
if Hardware::CPU.arm? | ||
url 'https://rtx.pub/v$RTX_VERSION/rtx-v$RTX_VERSION-macos-arm64.tar.xz' | ||
sha256 '$RTX_CHECKSUM_MACOS_ARM64' | ||
url "https://rtx.pub/v$RTX_VERSION/rtx-v$RTX_VERSION-macos-arm64.tar.xz" | ||
sha256 "$RTX_CHECKSUM_MACOS_ARM64" | ||
end | ||
end | ||
|
||
on_linux do | ||
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit? | ||
url 'https://rtx.pub/v$RTX_VERSION/rtx-v$RTX_VERSION-linux-arm64.tar.xz' | ||
sha256 '$RTX_CHECKSUM_LINUX_ARM64' | ||
url "https://rtx.pub/v$RTX_VERSION/rtx-v$RTX_VERSION-linux-arm64.tar.xz" | ||
sha256 "$RTX_CHECKSUM_LINUX_ARM64" | ||
end | ||
if Hardware::CPU.intel? | ||
url 'https://rtx.pub/v$RTX_VERSION/rtx-v$RTX_VERSION-linux-x64.tar.xz' | ||
sha256 '$RTX_CHECKSUM_LINUX_X86_64' | ||
url "https://rtx.pub/v$RTX_VERSION/rtx-v$RTX_VERSION-linux-x64.tar.xz" | ||
sha256 "$RTX_CHECKSUM_LINUX_X86_64" | ||
end | ||
end | ||
|
||
def install | ||
bin.install 'bin/rtx' | ||
man1.install 'man/man1/rtx.1' | ||
generate_completions_from_executable(bin / 'rtx', 'completion') | ||
bin.install "bin/rtx" | ||
man1.install "man/man1/rtx.1" | ||
generate_completions_from_executable(bin / "rtx", "completion") | ||
lib.mkpath | ||
touch lib / '.disable-self-update' | ||
touch lib / ".disable-self-update" | ||
end | ||
|
||
test do | ||
system "#{bin}/rtx --version" | ||
system "#{bin}/rtx", 'install', '[email protected]' | ||
assert_match 'v20.0.0', shell_output("#{bin}/rtx exec [email protected] -- node -v") | ||
system "#{bin}/rtx", "install", "[email protected]" | ||
assert_match "v20.0.0", shell_output("#{bin}/rtx exec [email protected] -- node -v") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters