@@ -38,7 +38,9 @@ archives:
38
38
{{- else }}{{ .Arch }}{{ end }}
39
39
format_overrides:
40
40
- goos: windows
41
- - formats: zip
41
+ formats: ["zip"]
42
+ - goos: darwin
43
+ formats: ["zip"]
42
44
checksum :
43
45
name_template : " checksums.txt"
44
46
snapshot :
@@ -84,15 +86,25 @@ homebrew_casks:
84
86
- formula : git
85
87
homepage : " https://pipelinesascode.com"
86
88
description : tkn-pac - A command line interface for interacting with Pipelines as Code
87
- hooks :
88
- pre :
89
- install : |
90
- bin.install "tkn-pac" => "tkn-pac"
91
- output = Utils.popen_read("SHELL=bash #{bin}/tkn-pac completion bash")
92
- (bash_completion/"tkn-pac").write output
93
- output = Utils.popen_read("SHELL=zsh #{bin}/tkn-pac completion zsh")
94
- (zsh_completion/"_tkn-pac").write output
95
- prefix.install_metafiles
89
+ binary : " tkn-pac"
90
+ custom_block : |
91
+ zsh_completion = "#{staged_path}/_tkn-pac"
92
+ bash_completion = "#{staged_path}/tkn-pac.bash"
93
+ fish_completion = "#{staged_path}/tkn-pac.fish"
94
+
95
+ preflight do
96
+ stdout, * = system_command "#{staged_path}/tkn-pac", args: ["completion", "bash"]
97
+ File.write bash_completion, stdout
98
+ stdout, * = system_command "#{staged_path}/tkn-pac", args: ["completion", "zsh"]
99
+ File.write zsh_completion, stdout
100
+ stdout, * = system_command "#{staged_path}/tkn-pac", args: ["completion", "fish"]
101
+ File.write fish_completion, stdout
102
+ end
103
+
104
+ binary zsh_completion, target: "#{HOMEBREW_PREFIX}/share/zsh/site-functions/_tkn-pac"
105
+ binary bash_completion, target: "#{HOMEBREW_PREFIX}/etc/bash_completion.d/tkn-pac"
106
+ binary fish_completion, target: "#{HOMEBREW_PREFIX}/share/fish/vendor_completions.d/tkn-pac.fish"
107
+
96
108
nfpms :
97
109
- file_name_template : >-
98
110
tkn-pac-
0 commit comments