diff --git a/Aliases/yq@4 b/Aliases/yq@4 new file mode 120000 index 00000000000..76bef9f02dc --- /dev/null +++ b/Aliases/yq@4 @@ -0,0 +1 @@ +../Formula/yq.rb \ No newline at end of file diff --git a/Formula/yq@3.rb b/Formula/yq@3.rb new file mode 100644 index 00000000000..db77d9771e8 --- /dev/null +++ b/Formula/yq@3.rb @@ -0,0 +1,22 @@ +class YqAT3 < Formula + desc "Process YAML documents from the CLI - Version 3" + homepage "https://github.com/mikefarah/yq" + url "https://github.com/mikefarah/yq/archive/3.4.1.tar.gz" + sha256 "73259f808d589d11ea7a18e4cd38a2e98b518a6c2c178d1ec57d9c5942277cb1" + license "MIT" + + keg_only :versioned_formula + + disable! date: "2021-08-01", because: :unmaintained + + depends_on "go" => :build + + def install + system "go", "build", "-ldflags", "-s -w", *std_go_args, "-o", bin/"yq" + end + + test do + assert_equal "key: cat", shell_output("#{bin}/yq n key cat").chomp + assert_equal "cat", pipe_output("#{bin}/yq r - key", "key: cat", 0).chomp + end +end