Skip to content

Commit

Permalink
fix brew complete
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonmar committed Apr 14, 2024
1 parent 0e48dda commit e770a4d
Show file tree
Hide file tree
Showing 4 changed files with 445 additions and 336 deletions.
20 changes: 13 additions & 7 deletions .zshrc
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env zsh
# gas "v0.27 # Add /opt/homebrew/bin for Apple Silicon ARM chips :.zshrc"
# gas "v0.28 # fix brew complete ; Add /opt/homebrew/bin for Apple Silicon ARM chips :.zshrc"
# This is file ~/.zshrc from template at https://github.com/wilsonmar/mac-setup/blob/main/.zshrc
# This is explained in https://wilsonmar.github.io/zsh
# This file is not provided by macOS by default.
Expand Down Expand Up @@ -27,6 +27,8 @@ export PATH="/opt/homebrew/bin;/usr/local/bin:/usr/local/opt:/usr/local/sbin:/bi
# /usr/sbin contains macOS chown, cron, disktutil, expect, fdisk, mkfile, softwareupdate, sysctl, etc.
# /sbin contains macOS fsck, mount, etc.

export PATH="$HOME/.ssh:${PATH}" # for SSH keys & certs.

# Where Apple puts *.app program folders that come with macOS (usually invoked manually by user):
export PATH="/Applications:$HOME/Applications:$HOME/Applications/Utilities:${PATH}" # for apps

Expand All @@ -40,10 +42,6 @@ fi

#### See https://wilsonmar.github.io/homebrew

# Provide a separate folder to install additional apps:
export HOMEBREW_CASK_OPTS="--appdir=~/Applications"
#export HOMEBREW_CASK_OPTS="--appdir=~/Applications --caskroom=~/Caskroom"

echo "Apple macOS sw_vers = $(sw_vers -productVersion) / uname = $(uname -r)" # sw_vers: 10.15.1 / uname = 21.4.0
# See https://eclecticlight.co/2020/08/13/macos-version-numbering-isnt-so-simple/
# See https://scriptingosx.com/2020/09/macos-version-big-sur-update/
Expand All @@ -53,17 +51,25 @@ if [[ "$(uname -m)" = *"arm64"* ]]; then
# used by .zshrc instead of .bash_profile
# On Apple M1 Monterey: /opt/homebrew/bin is where Zsh looks (instead of /usr/local/bin):
export BREW_PATH="/opt/homebrew"
complete "${BREW_PATH}/share/zsh/site-functions" # auto-completions in .bashrc
eval $( "${BREW_PATH}/bin/brew" shellenv)
# Password will be requested here.

elif [[ "$(uname -m)" = *"x86_64"* ]]; then
export BREW_PATH="/usr/local/bin"
# used by .bashrc and .bash_profile
fi

# Provide a separate folder to install additional apps:
export HOMEBREW_CASK_OPTS="--appdir=~/Applications"
#export HOMEBREW_CASK_OPTS="--appdir=~/Applications --caskroom=~/Caskroom"

if ! command -v complete >/dev/null; then
echo "brew complete NOT installed for BREW_PATH=$BREW_PATH to $HOMEBREW_CASK_OPTS"
else
echo "brew complete for BREW_PATH=$BREW_PATH to $HOMEBREW_CASK_OPTS"
complete "${BREW_PATH}/share/zsh/site-functions" # auto-completions in .bashrc
fi

echo "BREW_PATH=$BREW_PATH"
# Add to beginning of $PATH:
export PATH="$BREW_PATH/bin/:$BREW_PATH/bin/share/:${PATH}"
# /opt/homebrew/ contains folders bin, Cellar, Caskroom, completions, lib, opt, sbin, var, etc.
Expand Down
4 changes: 2 additions & 2 deletions aliases.zsh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,14 @@ if [[ "$(uname)" == *"Darwin"* ]]; then # it's on a Mac:
# echo "Adding functions for Mac ..."
# TODO: https://www.phillip-kruger.com/post/some_bash_functions_for_git/
alias vers="sw_vers"
function gas() { git status ; git add . -A ; git commit -m "$1" ; git push; }
function gas() { git status ; git add . -A ; git commit -S -m "$1" ; git push; }
function gsa() { git stash save "$1" -a; git stash list; } # -a = all (untracked, ignored)
function gsp() { git stash pop; }
function gd() { # get dirty
[[ $(git status 2> /dev/null | tail -n1) != *"working directory clean"* ]] && echo "*"
}
fi
alias gc='git commit -S -m --quiet' # requires you to type a Signed commit message
alias ga='git add . -A' # --patch
alias gb='git branch -avv'
# TODO: Add date/time to update text:
Expand All @@ -239,7 +240,6 @@ alias gds="git diff --staged"
alias get='git fetch;' # git pull + merge
alias gf='git fetch origin master;git diff master..origin/master'
alias gfu='git fetch upstream;git diff HEAD @{u} --name-only'
alias gc='git commit -S -m --quiet' # requires you to type a Signed commit message
alias gcm='git checkout master'
alias githead="git rev-parse --short HEAD" # current SHA commit ID
alias gl='git log --pretty=format:"%h %s %ad" --graph --since=1.days --date=relative;git log --show-signature -n 1'
Expand Down
42 changes: 23 additions & 19 deletions mac-setup.env
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# as described at https://wilsonmar.github.io/mac-setup

# CAUTION: No spaces around = sign.
export ENV_VER="v45" # akeyless:/mac-setup Secrets to AKeyless cloud
export ENV_VER="v50" # fix wmf move GITHUB add PLAYWRIGHT :mac-setup.env
# echo "At mac-setup.env $ENV_VER ..."

export ENV_FOLDERPATH_DEFAULT="$HOME" # for override by -envf $ENV_FOLDERPATH
Expand All @@ -18,13 +18,31 @@ export AKEYLESS_ACCESS_ID="p-ovktoe5swyx0im"
# For aiac.dev at https://github.com/gofireflyio/aiac
export OPENAI_API_KEY="akeyless:/mac-setup/OPENAI_API_KEY"

#export GITHUB_REPO_URL=""
#export GITHUB_REPO_NAME=""
#export GITHUB_FOLDER=""
#export GITHUB_BRANCH="main" # placeholder value

# Defined after creating a folder:
export GITHUB_ACCOUNT_FOLDER="github-wilsonmar"
export GITHUB_FOLDER_BASE="$HOME/github-wilsonmar"
# GITHB_FOLDER_PATH="$HOME/github-wilsonmar/$GITHUB_FOLDER_NAME"
export GITHUB_DOCS_REPO="wilsonmar.github.io"
export GITHUB_BRANCH_DEFAULT="main"

# Within .gitconfig, this is set by "git config --global user.name"
# [user]
# email = wilsonmar@gmail.com
# name = Wilson Mar
export GITHUB_USER_EMAIL="wilsonmar+github@gmail.com" #
export GITHUB_USER_NAME="Wilson Mar" # -n
export GITHUB_USER_ACCOUNT="wilsonmar" # -gan
# export GITHUB_KEY_NAME="wilsonmar_241231" # Gen'd as GITHUB_USER_ACCOUNT _ current date

# See https://wilsonmar.github.io/flood-the-internet#Playwright
export PLAYWRIGHT_SERVICE_URL=wss://eastus.api.playwright.microsoft.com/api/authorize/connectSession
export PLAYWRIGHT_SERVICE_ACCESS_TOKEN="/akeyless:/mac-setup/PLAYWRIGHT_SERVICE_ACCESS_TOKEN"

# Defined after creating a folder:
export GOHOME='$HOME/golang1' # this code highly customized!

Expand All @@ -34,9 +52,10 @@ export ROOT_APPS_TO_INSTALL="Keybase DiffMerge NordVPN PowerShell Slack Wha
# Also: Slack Zoom Discord Signal Telegram WhatsApp Skype
# Which folder?: CopyClip HiddenBar HandMiror Onyx (clean & fix) HazeOver (dim background)
# Also: "Microsoft-Edge Microsoft-Office Microsoft-Teams Microsoft-Visual-Studio-Code"
export HOME_APPS_TO_INSTALL="Docker Firefox google-cloud-sdk Hyper Macvim KeepassXC"
# How to use warp: https://www.youtube.com/watch?v=NfggT5enF4o&t=3m40s
export HOME_APPS_TO_INSTALL="Docker Firefox google-cloud-sdk Hyper KeepassXC LibreOffice Macvim Warp"
# Also: 1Password
export CLI_APPS_TO_INSTALL="curl wget jq htop tree git hub ncdu docker-compose hadolint 1password-cli graphviz"
export CLI_APPS_TO_INSTALL="curl docker-compose git graphviz hadolint htop hub jq ncdu tree wget"
# Also: ncdu, github
# https://graphviz.org/
# Specials: java done in code.
Expand Down Expand Up @@ -78,21 +97,6 @@ export AZURE_WORKSPACE="my-workspace"
# See https://wilsonmar.github.io/gcp
export GCP_PROJECT=""

export GITHUB_ACCOUNT="wilsonmar"
# Within .gitconfig, this is set by "git config --global user.name"
# [user]
# email = wilsonmar@gmail.com
# name = Wilson Mar
export GITHUB_USER_EMAIL="WilsonMar+GitHub@gmail.com"
export GITHUB_USER_ACCOUNT="wilsonmar" # -e
export GITHUB_USER_NAME="Wilson Mar" # -n
export GITHUB_ACCOUNT_NAME="wilsonmar" # -gan

#export GITHUB_REPO_URL=""
#export GITHUB_REPO_NAME=""
#export GITHUB_FOLDER=""
#export GITHUB_BRANCH="main" # placeholder value

export BRASTEN_API="/akeyless:/mac-setup/BRASTEN_API"

export CHEZMOI_CONFIG_FILE="~/.config/chezmoi/chezmoi.toml"
Expand Down Expand Up @@ -130,7 +134,7 @@ if [ -n "${GITHUB_FOLDER_BASE}" ]; then # variable is NOT blank (set by source
alias bs="wm;bundle exec jekyll serve --config _config.yml,_config_dev.yml"
alias wmo="cd $GITHUB_FOLDER_BASE/wilsonmar.github.io/_posts"
function wmf() { mdfind -onlyin $GITHUB_FOLDER_BASE/wilsonmar.github.io/_posts "$1" }
alias wf="cd $GITHUB_FOLDER_BASE/futures"
alias wmf="cd $GITHUB_FOLDER_BASE/futures"

alias wms='cd $GITHUB_FOLDER_BASE/mac-setup'
alias wm1='cd $GITHUB_FOLDER_BASE/Akl-Demo'
Expand Down
Loading

0 comments on commit e770a4d

Please sign in to comment.