Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1password: Update to provide completions on install #27438

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 34 additions & 6 deletions security/1password-cli/Portfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

Check warning on line 1 in security/1password-cli/Portfile

View workflow job for this annotation

GitHub Actions / macos-13

port test 1password-cli: Warning: 1password-cli is configured to build for the architecture(s) 'x86_64', but installed Mach-O files built for the following archs: Warning: arm64,x86_64: Warning: /opt/local/bin/op Warning:

Check warning on line 1 in security/1password-cli/Portfile

View workflow job for this annotation

GitHub Actions / macos-15

port test 1password-cli: Warning: 1password-cli is configured to build for the architecture(s) 'arm64', but installed Mach-O files built for the following archs: Warning: arm64,x86_64: Warning: /opt/local/bin/op Warning:

Check warning on line 1 in security/1password-cli/Portfile

View workflow job for this annotation

GitHub Actions / macos-14

port test 1password-cli: Warning: 1password-cli is configured to build for the architecture(s) 'arm64', but installed Mach-O files built for the following archs: Warning: arm64,x86_64: Warning: /opt/local/bin/op Warning:

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 @@ -48,17 +48,45 @@
system -W ${pkg_workpath} "cat ./Payload.cpio | cpio -i"
}

post-build {
set op ${pkg_workpath}/${bin_name}
set completions ${worksrcpath}/completions

xinstall -m 0755 -d ${completions}

foreach shell {bash fish zsh} {
system -nodup -W ${worksrcpath} \
"${op} completion ${shell} > ${completions}/${bin_name}.${shell}"
}
}

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

set completions ${worksrcpath}/completions

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

set fish_comp_path ${destroot}${prefix}/share/fish/vendor_completions.d
xinstall -m 0755 -d ${fish_comp_path}
xinstall -m 0644 ${completions}/${bin_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 ${completions}/${bin_name}.zsh ${zsh_comp_path}/_${bin_name}
}

livecheck.type regex
livecheck.url https://app-updates.agilebits.com/product_history/CLI2
livecheck.regex ${archive}_v(\\d+(\\.\\d+)+)${extract.suffix}

notes "
1Password CLI has been installed as ${bin_name}
notes {
1Password CLI has been installed as ${bin_name}

For instructions on getting started, see:
https://support.1password.com/command-line-getting-started/#get-started-with-the-command-line-tool
"
For instructions on getting started, see:
https://support.1password.com/command-line-getting-started/#get-started-with-the-command-line-tool

Completion scripts have been installed for Bash, Fish, and Zsh.
}