|
| 1 | +class HelloWorld < Formula |
| 2 | + desc "Simple program that outputs 'Hello, World!'" |
| 3 | + homepage "https://app.lizardbyte.dev" |
| 4 | + url "https://github.com/LizardByte/actions.git" |
| 5 | + version "0.0.1" |
| 6 | + |
| 7 | + bottle do |
| 8 | + root_url "https://ghcr.io/v2/lizardbyte/homebrew" |
| 9 | + rebuild 1 |
| 10 | + sha256 arm64_tahoe: "0000000000000000000000000000000000000000000000000000000000000000" |
| 11 | + sha256 arm64_sequoia: "0000000000000000000000000000000000000000000000000000000000000000" |
| 12 | + sha256 arm64_sonoma: "0000000000000000000000000000000000000000000000000000000000000000" |
| 13 | + sha256 x86_64_linux: "0000000000000000000000000000000000000000000000000000000000000000" |
| 14 | + end |
| 15 | + |
| 16 | + def install |
| 17 | + # create hello world sh file with echo command |
| 18 | + (buildpath/"hello-world").write <<~EOS |
| 19 | + #!/bin/sh |
| 20 | + echo "Hello, World!" |
| 21 | + EOS |
| 22 | + |
| 23 | + # install the hello-world file to the bin directory |
| 24 | + bin.install "hello-world" |
| 25 | + |
| 26 | + puts "buildpath: #{buildpath}" |
| 27 | + end |
| 28 | + |
| 29 | + test do |
| 30 | + system "#{bin}/hello-world" |
| 31 | + |
| 32 | + puts "testpath: #{testpath}" |
| 33 | + |
| 34 | + # test the env |
| 35 | + if ENV["HOMEBREW_BUILDPATH"] |
| 36 | + dummy_filename = "dummy.txt" |
| 37 | + cd File.join(ENV["HOMEBREW_BUILDPATH"]) do |
| 38 | + # create a dummy file |
| 39 | + File.write(dummy_filename, "Hello, World!") |
| 40 | + assert_path_exists dummy_filename |
| 41 | + end |
| 42 | + assert_path_exists File.join(ENV["HOMEBREW_BUILDPATH"], dummy_filename) |
| 43 | + end |
| 44 | + end |
| 45 | +end |
| 46 | +# Created from LizardByte/actions@1f6d359a26a1bcb9cb5a20c01e293698f9c391c9 |
0 commit comments