mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-08-07 06:08:39 +02:00
- fix(aws): quote dirname in state file path check to handle spaces (#13868) - Add gcbc helper to copy current git branch name (#13867) - fix(archlinux): remove unnecessary sudo from paclsorphans (#13866)
This commit is contained in:
parent
b37dd49ca5
commit
369d845187
5 changed files with 13 additions and 4 deletions
|
|
@ -21,7 +21,7 @@ plugins=(... archlinux)
|
||||||
| pacloc | `pacman -Qi` | Display information about a package in the local database |
|
| pacloc | `pacman -Qi` | Display information about a package in the local database |
|
||||||
| paclocs | `pacman -Qs` | Search for packages in the local database |
|
| paclocs | `pacman -Qs` | Search for packages in the local database |
|
||||||
| paclr | `sudo pacman -Scc` | Remove all files from the cache |
|
| paclr | `sudo pacman -Scc` | Remove all files from the cache |
|
||||||
| paclsorphans | `sudo pacman -Qdt` | List all orphaned packages |
|
| paclsorphans | `pacman -Qdt` | List all orphaned packages |
|
||||||
| pacmir | `sudo pacman -Syy` | Force refresh of all package lists after updating mirrorlist |
|
| pacmir | `sudo pacman -Syy` | Force refresh of all package lists after updating mirrorlist |
|
||||||
| pacre | `sudo pacman -R` | Remove packages, keeping its settings and dependencies |
|
| pacre | `sudo pacman -R` | Remove packages, keeping its settings and dependencies |
|
||||||
| pacrem | `sudo pacman -Rns` | Remove packages, including its settings and dependencies |
|
| pacrem | `sudo pacman -Rns` | Remove packages, including its settings and dependencies |
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ alias pacloc='pacman -Qi'
|
||||||
alias paclocs='pacman -Qs'
|
alias paclocs='pacman -Qs'
|
||||||
alias pacinsd='sudo pacman -S --asdeps'
|
alias pacinsd='sudo pacman -S --asdeps'
|
||||||
alias pacmir='sudo pacman -Syy'
|
alias pacmir='sudo pacman -Syy'
|
||||||
alias paclsorphans='sudo pacman -Qdt'
|
alias paclsorphans='pacman -Qdt'
|
||||||
alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)'
|
alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)'
|
||||||
alias pacfileupg='sudo pacman -Fy'
|
alias pacfileupg='sudo pacman -Fy'
|
||||||
alias pacfiles='pacman -F'
|
alias pacfiles='pacman -F'
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,14 @@ function agr() {
|
||||||
# Update state file if enabled
|
# Update state file if enabled
|
||||||
function _aws_update_state() {
|
function _aws_update_state() {
|
||||||
if [[ "$AWS_PROFILE_STATE_ENABLED" == true ]]; then
|
if [[ "$AWS_PROFILE_STATE_ENABLED" == true ]]; then
|
||||||
test -d $(dirname ${AWS_STATE_FILE}) || return 1
|
test -d "$(dirname "${AWS_STATE_FILE}")" || return 1
|
||||||
echo "${AWS_PROFILE} ${AWS_REGION}" > "${AWS_STATE_FILE}"
|
echo "${AWS_PROFILE} ${AWS_REGION}" > "${AWS_STATE_FILE}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function _aws_clear_state() {
|
function _aws_clear_state() {
|
||||||
if [[ "$AWS_PROFILE_STATE_ENABLED" == true ]]; then
|
if [[ "$AWS_PROFILE_STATE_ENABLED" == true ]]; then
|
||||||
test -d $(dirname ${AWS_STATE_FILE}) || return 1
|
test -d "$(dirname "${AWS_STATE_FILE}")" || return 1
|
||||||
echo -n > "${AWS_STATE_FILE}"
|
echo -n > "${AWS_STATE_FILE}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -255,6 +255,7 @@ receive further support.
|
||||||
| `git_develop_branch` | Returns the name of the “development” branch: `dev`, `devel`, `development` if they exist, `develop` otherwise |
|
| `git_develop_branch` | Returns the name of the “development” branch: `dev`, `devel`, `development` if they exist, `develop` otherwise |
|
||||||
| `git_main_branch` | Returns the name of the main branch: `main` if it exists, `master` otherwise |
|
| `git_main_branch` | Returns the name of the main branch: `main` if it exists, `master` otherwise |
|
||||||
| `grename <old> <new>` | Renames branch `<old>` to `<new>`, including on the origin remote |
|
| `grename <old> <new>` | Renames branch `<old>` to `<new>`, including on the origin remote |
|
||||||
|
| `gcbc` | Copies the current branch name to the system clipboard (uses `clipcopy`) |
|
||||||
| `gbda` | Deletes all merged branches |
|
| `gbda` | Deletes all merged branches |
|
||||||
| `gbds` | Deletes all squash-merged branches (**Note: performance degrades with number of branches**) |
|
| `gbds` | Deletes all squash-merged branches (**Note: performance degrades with number of branches**) |
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -159,6 +159,14 @@ alias gbg='LANG=C git branch -vv | grep ": gone\]"'
|
||||||
alias gco='git checkout'
|
alias gco='git checkout'
|
||||||
alias gcor='git checkout --recurse-submodules'
|
alias gcor='git checkout --recurse-submodules'
|
||||||
alias gcb='git checkout -b'
|
alias gcb='git checkout -b'
|
||||||
|
function gcbc() {
|
||||||
|
local branch=$(git branch --show-current 2>/dev/null) || return
|
||||||
|
if [[ -z "$branch" ]]; then
|
||||||
|
print -u2 "gcbc: not on a branch"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
print -rn -- "$branch" | clipcopy
|
||||||
|
}
|
||||||
alias gcB='git checkout -B'
|
alias gcB='git checkout -B'
|
||||||
alias gcd='git checkout $(git_develop_branch)'
|
alias gcd='git checkout $(git_develop_branch)'
|
||||||
alias gcm='git checkout $(git_main_branch)'
|
alias gcm='git checkout $(git_main_branch)'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue