From 29b3e9dea0d76bdbf569ca7ef04c4f05b14949a4 Mon Sep 17 00:00:00 2001 From: PorridgePi Date: Wed, 28 Sep 2022 19:30:02 +0800 Subject: [PATCH] zshrc: refactor: Use new variables for OS-specific section --- .zshrc | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/.zshrc b/.zshrc index a3159f7..5edabcf 100644 --- a/.zshrc +++ b/.zshrc @@ -67,6 +67,25 @@ zinit light-mode for \ ### End of Zinit's installer chunk +########## Personal - OS-Specific ############################################# + +if [[ "$OSNAME" == "Linux" ]]; then + ##### Linux + +elif [[ "$OSNAME" == "macOS" ]]; then + ##### macOS + ### Aliases + # Intel (Rosetta 2) Homebrew + alias ibrew='arch -x86_64 /usr/local/bin/brew' + + # Homebrew + eval "$(/opt/homebrew/bin/brew shellenv)" +else + ##### Unknown + +fi + + ########## Personal ########################################################### export PATH="$HOME/bin:$PATH" export TERM=xterm-256color @@ -102,24 +121,6 @@ bindkey '^[[A' history-substring-search-up bindkey '^[[B' history-substring-search-down export HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=true -########## OS-Specific ######################################################## - -if [[ "$OSTYPE" == "linux-gnu"* ]]; then - ##### Linux - -elif [[ "$OSTYPE" == "darwin"* ]]; then - ##### macOS - ### Aliases - # Intel (Rosetta 2) Homebrew - alias ibrew='arch -x86_64 /usr/local/bin/brew' - - # Homebrew - eval "$(/opt/homebrew/bin/brew shellenv)" -else - ##### Unknown - -fi - ########## pnpm ############################################################### export PNPM_HOME="/Users/porridge/Library/pnpm"