forked from iad1tya/Quitty
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquitty.rb
More file actions
66 lines (52 loc) · 1.75 KB
/
quitty.rb
File metadata and controls
66 lines (52 loc) · 1.75 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
class Quitty < Formula
desc "macOS system optimization and cleanup utility"
homepage "https://github.com/iad1tya/Quitty"
url "https://github.com/iad1tya/Quitty/releases/download/v1.0.0/Quitty.zip"
sha256 "a1b2c3d4e5f6789012345678901234567890123456789012345678901234567890"
license "MIT"
depends_on :macos
def install
# Download and extract the app
system "curl", "-L", url, "-o", "quitty.zip"
system "unzip", "quitty.zip"
# Install the app to Applications folder
app_path = "Quitty.app"
if File.exist?(app_path)
prefix.install app_path
else
odie "Quitty.app not found in downloaded archive"
end
# Clean up
system "rm", "quitty.zip"
end
def post_install
# Create a symlink in /Applications for easier access
app_path = prefix/"Quitty.app"
target_path = "/Applications/Quitty.app"
if File.exist?(target_path)
FileUtils.rm_f(target_path)
end
FileUtils.ln_s(app_path, target_path) unless File.exist?(target_path)
ohai "Quitty has been installed to #{app_path}"
ohai "A symlink has been created in #{target_path}"
ohai "You can now launch Quitty from your Applications folder"
end
def uninstall
# Remove symlink from Applications
FileUtils.rm_f("/Applications/Quitty.app")
end
test do
# Basic test to check if app exists
assert_predicate prefix/"Quitty.app", :exist?
end
caveats do
<<~EOS
Quitty has been installed and is available in your Applications folder.
To run Quitty:
- Open it from Applications folder, or
- Run: open #{prefix}/Quitty.app
The app will quit when you close the main window.
Installation command: brew install quitty
EOS
end
end