Skip to content

Commit

Permalink
1password: Update to provide completions on install
Browse files Browse the repository at this point in the history
  • Loading branch information
halostatue committed Jan 21, 2025
1 parent 31e00ae commit 9660ea0
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion security/1password-cli/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PortSystem 1.0

name 1password-cli
version 2.30.3
revision 0
revision 1

homepage https://support.1password.com/command-line

Expand Down Expand Up @@ -46,10 +46,27 @@ build {}
post-extract {
system -W ${pkg_workpath} "cat ./Payload | gzip -d > ./Payload.cpio"
system -W ${pkg_workpath} "cat ./Payload.cpio | cpio -i"

foreach shell {bash fish zsh} {
system -W ${pkg_workpath} \
"./${bin_name} completion ${shell} > ${name}.${shell}"
}
}

destroot {
xinstall -m 0755 ${pkg_workpath}/${bin_name} ${destroot}${prefix}/bin

set bash_comp_path ${destroot}${prefix}/share/bash-completion/completions
xinstall -m 0755 -d ${bash_comp_path}
xinstall -m 0644 ${pkg_workpath}/${name}.bash ${bash_comp_path}/${name}

set fish_comp_path ${destroot}${prefix}/share/fish/vendor_completions.d
xinstall -m 0755 -d ${fish_comp_path}
xinstall -m 0644 ${pkg_workpath}/${name}.fish ${fish_comp_path}

set zsh_comp_path ${destroot}${prefix}/share/zsh/site-functions
xinstall -m 0755 -d ${zsh_comp_path}
xinstall -m 0644 ${pkg_workpath}/${name}.zsh ${zsh_comp_path}/_${name}
}

livecheck.type regex
Expand Down

0 comments on commit 9660ea0

Please sign in to comment.