tenseleyflow/parrot / 00e882d

Browse files

fix install parrot-hook.fish for fish shell support

Authored by espadonne
SHA
00e882d29583af82b32f666715c413fd54ae4927
Parents
e1f7f89
Tree
494706b

2 changed files

StatusFile+-
A homebrew-formula/parrot.rb 53 0
M parrot.spec 2 0
homebrew-formula/parrot.rbadded
@@ -0,0 +1,53 @@
1
+class Parrot < Formula
2
+  desc "Intelligent CLI command failure assistant with AI-powered responses"
3
+  homepage "https://repos.musicsian.com/parrot.html"
4
+  url "https://github.com/tenseleyFlow/parrot/archive/v1.3.0.tar.gz"
5
+  sha256 "7f870446f598df8a91305ab01b58d1f1887b2073f3879497c67c87b7d4d28047"
6
+  license "MIT"
7
+
8
+  depends_on "go" => :build
9
+
10
+  def install
11
+    system "go", "build", *std_go_args(ldflags: "-w -s")
12
+
13
+    # Install shell hooks
14
+    share.install "parrot-hook.sh"
15
+    share.install "parrot-hook.fish"
16
+
17
+    # Install example configuration
18
+    etc.install "config/parrot.toml.example" => "parrot/parrot.toml.example"
19
+
20
+    # Install documentation
21
+    doc.install "README.md" if File.exist?("README.md")
22
+  end
23
+
24
+  def caveats
25
+    <<~EOS
26
+      🦜 Parrot has been installed successfully!
27
+
28
+      🚀 NEXT STEP: Run this command to enable shell integration:
29
+          parrot install
30
+
31
+      💡 This adds smart command failure detection to your shell
32
+         After running it, failed commands will trigger helpful responses!
33
+
34
+      📖 For more options, run: parrot --help
35
+
36
+      🤖 For AI-powered responses, install Ollama:
37
+         brew install ollama
38
+         ollama pull llama3.2:3b
39
+    EOS
40
+  end
41
+
42
+  test do
43
+    # Test basic functionality
44
+    assert_match "parrot", shell_output("#{bin}/parrot --help")
45
+
46
+    # Test mock command (should work without backend setup)
47
+    output = shell_output("#{bin}/parrot mock 'git push' 1")
48
+    assert_match "🦜", output
49
+
50
+    # Test configuration command
51
+    assert_match "Configuration", shell_output("#{bin}/parrot status")
52
+  end
53
+end
parrot.specmodified
@@ -47,6 +47,7 @@ install -m 755 parrot %{buildroot}%{_bindir}/parrot
4747
 # Install shell integration hooks
4848
 install -d %{buildroot}%{_datadir}/%{name}
4949
 install -m 644 parrot-hook.sh %{buildroot}%{_datadir}/%{name}/parrot-hook.sh
50
+install -m 644 parrot-hook.fish %{buildroot}%{_datadir}/%{name}/parrot-hook.fish
5051
 
5152
 # Install configuration templates
5253
 install -d %{buildroot}%{_sysconfdir}/%{name}
@@ -103,6 +104,7 @@ fi
103104
 %files
104105
 %{_bindir}/parrot
105106
 %{_datadir}/%{name}/parrot-hook.sh
107
+%{_datadir}/%{name}/parrot-hook.fish
106108
 %{_sysconfdir}/%{name}/parrot.toml.example
107109
 %{_docdir}/%{name}/
108110