Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions Formula/h/hello_world.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
class HelloWorld < Formula
HELLO_WORLD_EXECUTABLE = "hello-world".freeze

desc "Simple program that outputs 'Hello, World!'"
homepage "https://app.lizardbyte.dev"
url "https://github.com/LizardByte/actions.git"
version "0.0.1"

bottle do
root_url "https://ghcr.io/v2/lizardbyte/homebrew"
rebuild 1
sha256 arm64_tahoe: "0000000000000000000000000000000000000000000000000000000000000000"
sha256 arm64_sequoia: "0000000000000000000000000000000000000000000000000000000000000000"
sha256 arm64_sonoma: "0000000000000000000000000000000000000000000000000000000000000000"
sha256 x86_64_linux: "0000000000000000000000000000000000000000000000000000000000000000"
end

def install
# create hello world sh file with echo command
(buildpath/HELLO_WORLD_EXECUTABLE).write <<~EOS
#!/bin/sh
echo "Hello, World!"
EOS
chmod "+x", buildpath/HELLO_WORLD_EXECUTABLE

# install the hello-world file to the bin directory
bin.install HELLO_WORLD_EXECUTABLE

puts "buildpath: #{buildpath}"
end

test do
assert_equal "Hello, World!", shell_output("#{bin}/#{HELLO_WORLD_EXECUTABLE}").strip

puts "testpath: #{testpath}"

# test the env
if ENV["HOMEBREW_BUILDPATH"]
dummy_filename = "dummy.txt"
cd File.join(ENV["HOMEBREW_BUILDPATH"]) do
# create a dummy file
File.write(dummy_filename, "Hello, World!")
assert_path_exists dummy_filename
end
assert_path_exists File.join(ENV["HOMEBREW_BUILDPATH"], dummy_filename)
end
end
end
# Created from LizardByte/actions@9b5043bd4a680916d7f14a8f0536d80764ff3f76
Loading