1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2025-12-12 15:34:50 +08:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Joseph Heyburn
e2f2489a66
fix(git): silently fail in git_main_branch if not in a git repo (#9484)
Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2020-12-08 18:25:42 +01:00
Marc Cornellà
452586e79a chore: add Josh Medeski as wp-cli plugin maintainer 2020-12-07 22:01:43 +01:00
ratijas
865d2d8a53
refactor(archlinux): prevent leaking local variables (#9476)
Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2020-12-07 22:00:25 +01:00
3 changed files with 10 additions and 10 deletions

1
.github/CODEOWNERS vendored
View File

@ -3,3 +3,4 @@ plugins/aws/ @maksyms
plugins/git-lfs/ @vietduc01100001
plugins/gitfast/ @felipec
plugins/sdk/ @rgoldberg
plugins/wp-cli/ @joshmedeski

View File

@ -171,14 +171,13 @@ function paclist() {
}
function pacdisowned() {
emulate -L zsh
local tmp db fs
tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$
db=$tmp/db
fs=$tmp/fs
mkdir "$tmp"
trap 'rm -rf "$tmp"' EXIT
trap 'rm -rf "$tmp"' EXIT
pacman -Qlq | sort -u > "$db"
@ -189,15 +188,14 @@ function pacdisowned() {
}
function pacmanallkeys() {
emulate -L zsh
curl -s https://www.archlinux.org/people/{developers,trustedusers}/ | \
awk -F\" '(/pgp.mit.edu/) { sub(/.*search=0x/,""); print $1}' | \
xargs sudo pacman-key --recv-keys
}
function pacmansignkeys() {
emulate -L zsh
for key in $*; do
local key
for key in $@; do
sudo pacman-key --recv-keys $key
sudo pacman-key --lsign-key $key
printf 'trust\n3\n' | sudo gpg --homedir /etc/pacman.d/gnupg \
@ -207,13 +205,13 @@ function pacmansignkeys() {
if (( $+commands[xdg-open] )); then
function pacweb() {
pkg="$1"
infos="$(LANG=C pacman -Si "$pkg")"
local pkg="$1"
local infos="$(LANG=C pacman -Si "$pkg")"
if [[ -z "$infos" ]]; then
return
fi
repo="$(grep -m 1 '^Repo' <<< "$infos" | grep -oP '[^ ]+$')"
arch="$(grep -m 1 '^Arch' <<< "$infos" | grep -oP '[^ ]+$')"
local repo="$(grep -m 1 '^Repo' <<< "$infos" | grep -oP '[^ ]+$')"
local arch="$(grep -m 1 '^Arch' <<< "$infos" | grep -oP '[^ ]+$')"
xdg-open "https://www.archlinux.org/packages/$repo/$arch/$pkg/" &>/dev/null
}
fi

View File

@ -31,6 +31,7 @@ function work_in_progress() {
# Check if main exists and use instead of master
function git_main_branch() {
command git rev-parse --git-dir &>/dev/null || return
local branch
for branch in main trunk; do
if command git show-ref -q --verify refs/heads/$branch; then