Skip to content

Commit

Permalink
Merge pull request #203732 from Homebrew/anyenv-updates
Browse files Browse the repository at this point in the history
anyenv: build all bottle, update test
  • Loading branch information
BrewTestBot authored Jan 9, 2025
2 parents 96ec349 + 2bbd8cc commit a607ae9
Showing 1 changed file with 18 additions and 31 deletions.
49 changes: 18 additions & 31 deletions Formula/a/anyenv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,31 @@ class Anyenv < Formula
license "MIT"

bottle do
sha256 cellar: :any_skip_relocation, arm64_sequoia: "f0c5c9923085a2a772fa142aa3d1ddb3e02015553306c6f3ce7747a9bc4d9e64"
sha256 cellar: :any_skip_relocation, arm64_sonoma: "e462542223d5607086423b094fc86298425826c8f82c8d9566e9e1598ec3017d"
sha256 cellar: :any_skip_relocation, arm64_ventura: "6fcafa1cbde4f24bb3e88597312c279ad4ad34e5ab80b51a2e1e96afb8b97157"
sha256 cellar: :any_skip_relocation, arm64_monterey: "6fcafa1cbde4f24bb3e88597312c279ad4ad34e5ab80b51a2e1e96afb8b97157"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "6fcafa1cbde4f24bb3e88597312c279ad4ad34e5ab80b51a2e1e96afb8b97157"
sha256 cellar: :any_skip_relocation, sonoma: "73879c37bbfdac38f5f3057182da253d44732fa54c77cb483c8a2cbae9897bdd"
sha256 cellar: :any_skip_relocation, ventura: "e7a9bd58702840c6aee47e42ff2691681721a494a47cceac00cf10e1b1748879"
sha256 cellar: :any_skip_relocation, monterey: "e7a9bd58702840c6aee47e42ff2691681721a494a47cceac00cf10e1b1748879"
sha256 cellar: :any_skip_relocation, big_sur: "e7a9bd58702840c6aee47e42ff2691681721a494a47cceac00cf10e1b1748879"
sha256 cellar: :any_skip_relocation, catalina: "e7a9bd58702840c6aee47e42ff2691681721a494a47cceac00cf10e1b1748879"
sha256 cellar: :any_skip_relocation, x86_64_linux: "6fcafa1cbde4f24bb3e88597312c279ad4ad34e5ab80b51a2e1e96afb8b97157"
rebuild 1
sha256 cellar: :any_skip_relocation, all: "be1c3998ca482ca2cf3377f5db6690f1c74877e5cdfc4266d62c5cc1627caacd"
end

def install
inreplace "libexec/anyenv", "/usr/local", HOMEBREW_PREFIX
prefix.install %w[bin completions libexec]
end

test do
Dir.mktmpdir do |dir|
profile = "#{dir}/.profile"
File.open(profile, "w") do |f|
content = <<~SHELL
export ANYENV_ROOT=#{dir}/anyenv
export ANYENV_DEFINITION_ROOT=#{dir}/anyenv-install
eval "$(anyenv init -)"
SHELL
f.write(content)
end
anyenv_root = testpath/"anyenv"
profile = testpath/".profile"
profile.write <<~SHELL
export ANYENV_ROOT=#{anyenv_root}
export ANYENV_DEFINITION_ROOT=#{testpath}/anyenv-install
eval "$(#{bin}/anyenv init -)"
SHELL

cmds = <<~SHELL
anyenv install --force-init
anyenv install --list
anyenv install rbenv
rbenv install --list
SHELL
cmds.split("\n").each do |cmd|
shell_output(". #{profile} && #{cmd}")
end
end
anyenv_install = ". #{profile} && #{bin}/anyenv install"
assert_match "Completed!", shell_output("#{anyenv_install} --force-init")
assert_match(/^\s*rbenv$/, shell_output("#{anyenv_install} --list"))
assert_match "succeeded!", shell_output("#{anyenv_install} rbenv")

anyenv_rbenv_path = "#{anyenv_root}/envs/rbenv/bin/rbenv"
assert_equal anyenv_rbenv_path, shell_output(". #{profile} && which rbenv").chomp
assert_match(/^\d+\.\d+\.\d+$/, shell_output(". #{profile} && rbenv install --list"))
end
end

0 comments on commit a607ae9

Please sign in to comment.