-
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathhello_world.rb
More file actions
49 lines (41 loc) · 1.59 KB
/
Copy pathhello_world.rb
File metadata and controls
49 lines (41 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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