Skip to content

Commit

Permalink
enable to switch arch
Browse files Browse the repository at this point in the history
  • Loading branch information
cappyzawa committed Jan 4, 2024
1 parent e3ba487 commit d8236fa
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
10 changes: 10 additions & 0 deletions .zprofile
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,13 @@ fi

# fzf - command-line fuzzy finder (https://github.com/junegunn/fzf)
export FZF_DEFAULT_OPTS="--extended --ansi --multi"

ARCH=$(uname -m)
if [[ $ARCH == arm64 ]]; then
echo "Current Architecture: $ARCH"
eval "$(/opt/homebrew/bin/brew shellenv)"
elif [[ $ARCH == x86_64 ]]; then
echo "Current Architecture: $ARCH"
eval "$(/usr/local/bin/brew shellenv)"
fi
export LDFLAGS="-L$HOMEBREW_PREFIX/lib"
4 changes: 0 additions & 4 deletions .zsh/10_utils.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ os() {

alias ostype=os

arch() {
echo "$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')"
}

# os_detect export the PLATFORM variable as you see fit
os_detect() {
export PLATFORM
Expand Down
3 changes: 3 additions & 0 deletions .zsh/30_aliases.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ if is_osx; then
fi

alias -g vy="| vim '+set filetype=yaml buftype=nofile'"

alias arm="exec arch -arch arm64 /bin/zsh --login"
alias x64="exec arch -arch x86_64 /bin/zsh --login"
2 changes: 0 additions & 2 deletions .zshenv
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,3 @@ fi
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
. "$HOME/.cargo/env"

eval "$(/opt/homebrew/bin/brew shellenv)"

0 comments on commit d8236fa

Please sign in to comment.