Skip to content

Commit

Permalink
update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
sammcj committed Jul 14, 2023
1 parent 539d89d commit 66597bf
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 7 deletions.
18 changes: 16 additions & 2 deletions 4-aliases.rc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,22 @@ alias zshconfig="code ${THIS_DIRECTORY}"
#shellcheck disable=SC2139
alias zshconfigd="cd ${THIS_DIRECTORY}"

# Packages
alias ba="brew update && brew upgrade --greedy; brew upgrade --cask --greedy; pip install -U pip; pip3 install -U pip; zgen selfupdate; zgen update; vim +PluginUpdate +qall; \ncu --global; mas upgrade; gup update; omz update; brew cleanup"
# Packages #TODO: Convert this to a function
alias ba="brew update &&
__update_chromium;
brew upgrade --greedy;
brew upgrade --cask --greedy;
pip install -U pip;
pip3 install -U pip;
zgen selfupdate;
zgen update;
vim +PluginUpdate +qall;
\ncu --global;
mas upgrade;
gup update;
omz update;
brew cleanup;
brew autoremove"
alias app_store_upgrade_mmas="mas upgrade"
alias go_update_all="gup update"
alias pa="pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U"
Expand Down
4 changes: 2 additions & 2 deletions 7-history.rc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
HISTFILE=~/.history

# Remember a lot of history (AWESOME)
export SAVEHIST=1000000
export HISTSIZE=1000000
export SAVEHIST=2000000
export HISTSIZE=2000000

# Don't overwrite, append!
setopt APPEND_HISTORY
Expand Down
18 changes: 15 additions & 3 deletions 9-functions.rc
Original file line number Diff line number Diff line change
Expand Up @@ -857,8 +857,11 @@ function gh_pr_list_open_dir_repos() {

for repo in */; do
if [[ -d "$repo" ]]; then
repo_name=$(basename "$repo")
repo_owner=$(basename "$(dirname "$repo")")
# Get the repo name from the git config
repo_name=$(git -C "$repo" config --get remote.origin.url | sed -E 's/.*github.com[:/].*\/(.*)\.git/\1/')
# Get the repo owner from the git config
repo_owner=$(git -C "$repo" config --get remote.origin.url | sed -E 's/.*github.com[:/](.*)\/.*/\1/')

echo "Repository: $repo_owner/$repo_name"

gh_pr_list_open --repo "$repo_owner/$repo_name" --match "$search_param" "${other_params[@]}"
Expand Down Expand Up @@ -920,7 +923,6 @@ zle -N insert-last-command-output
bindkey "^Q^L" insert-last-command-output
### End get output from last command ###


# if ifup or ifdown is run - remind the user of the correct
ifup() {
echo "Did you mean 'ip link set $1 up'?"
Expand All @@ -929,3 +931,13 @@ ifup() {
ifdown() {
echo "Did you mean 'ip link set $1 down'?"
}

# A small function that updates chromium (don't worry - my main browser is Firefox) and removes the extended attributes that cause it to be quarantined by macOS
__update_chromium() {
brew upgrade --cask chromium

# if chromium was upgraded and is quarantined, remove the quarantine
if [[ -f "/Applications/Chromium.app/Contents/MacOS/Chromium" ]]; then
xattr -d com.apple.quarantine "/Applications/Chromium.app/Contents/MacOS/Chromium"
fi
}

0 comments on commit 66597bf

Please sign in to comment.