fix(bootstrap): Fix macOS script

This commit is contained in:
whoami 2025-02-15 21:14:34 +00:00
parent d9aa8fafdb
commit 041a509481
4 changed files with 34 additions and 18 deletions

View file

@ -1,14 +1,19 @@
echo "[INFO] ZDOTDIR = $ZDOTDIR" echo "[INFO] ZDOTDIR = $ZDOTDIR"
echo "[INFO] DOTFILES = $DOTFILES" echo "[INFO] DOTFILES = $DOTFILES"
echo "[ACTION] Press any key to proceed" # echo "[ACTION] Press any key to proceed"
read -n 1 -s -r # read -n 1 -s -r
echo "[INFO] Setting up system-wide zsh configuration" echo "[INFO] Setting up system-wide zsh configuration"
echo "[ACTION] Elevation required!" echo "[ACTION] Elevation required"
test -f "/etc/zsh/zshenv" && sudo cp "$DOTFILES/tools/zsh/zshenv" "/etc/zsh/zshenv" test -f "/etc/zsh/zshenv" && sudo cp "$DOTFILES/tools/zsh/zshenv" "/etc/zsh/zshenv"
test -f "/etc/zshenv" && sudo cp "$DOTFILES/tools/zsh/zshenv" "/etc/zshenv" test -f "/etc/zshenv" && sudo cp "$DOTFILES/tools/zsh/zshenv" "/etc/zshenv"
if [ $(uname) = "Darwin" ]; then
sudo cp "$DOTFILES/tools/zsh/zshenv" "/etc/zshenv"
fi
echo "[INFO] Installing zsh plugins" echo "[INFO] Installing zsh plugins"
test -d $ZDOTDIR/plugins/zsh-autosuggestions || git clone --depth 1 https://github.com/zsh-users/zsh-autosuggestions.git $ZDOTDIR/plugins/zsh-autosuggestions test -d $ZDOTDIR/plugins/zsh-autosuggestions || git clone --depth 1 https://github.com/zsh-users/zsh-autosuggestions.git $ZDOTDIR/plugins/zsh-autosuggestions
test -d $ZDOTDIR/plugins/zsh-syntax-highlighting || git clone --depth 1 https://github.com/zsh-users/zsh-syntax-highlighting.git $ZDOTDIR/plugins/zsh-syntax-highlighting test -d $ZDOTDIR/plugins/zsh-syntax-highlighting || git clone --depth 1 https://github.com/zsh-users/zsh-syntax-highlighting.git $ZDOTDIR/plugins/zsh-syntax-highlighting

View file

@ -14,7 +14,8 @@ echo "[ACTION] Request Human Takeover"
xcode-select --install xcode-select --install
# Press any key to continue (if Xcode Command Line Tools are installed) # Press any key to continue (if Xcode Command Line Tools are installed)
read -n 1 -s -r -p "Press any key to continue when xcode CLI tools are installed" echo "[ACTION] Press any key to continue when xcode CLI tools are installed"
read -n 1
# System Preferences # System Preferences
# Installation Sources # Installation Sources
@ -29,7 +30,9 @@ echo "[INFO] Installing Homebrew"
echo "[ACTION] Request Human Input" echo "[ACTION] Request Human Input"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
read -n 1 -s -r -p "Press any key to continue when xcode CLI tools are installed"
echo "[ACTION] Press any key to continue when xcode CLI tools are installed"
read -n 1
echo "[INFO] Cloning Dotfiles" echo "[INFO] Cloning Dotfiles"
@ -45,6 +48,10 @@ echo "[INFO] Installing Homebrew Packages"
eval "$(/opt/homebrew/bin/brew shellenv)" eval "$(/opt/homebrew/bin/brew shellenv)"
brew bundle --file=$DOTFILES/bootstrap/macOS/Brewfile brew bundle --file=$DOTFILES/bootstrap/macOS/Brewfile
# Setting up emacs
ln -s /usr/local/opt/emacs-mac/Emacs.app /Applications/Emacs.app
# Setting Default Apps # Setting Default Apps
source $DOTFILES/bootstrap/macOS/duti.zsh source $DOTFILES/bootstrap/macOS/duti.zsh
@ -62,10 +69,12 @@ source $DOTFILES/tools/zsh/zshrc
echo "[INFO] Installing Rime" echo "[INFO] Installing Rime"
git clone --depth 1 https://github.com/js0ny/Rime.git ~/Library/Rime git clone --depth 1 https://github.com/js0ny/rime_wanxiang_pro.git ~/Library/Rime
cd ~/Library/Rime cd ~/Library/Rime
just set_remote just init
# just install_rime
## Rime is installed via Brewfile
just clone_plum just clone_plum
echo "[INFO] Installing Doom Emacs" echo "[INFO] Installing Doom Emacs"

View file

@ -16,15 +16,15 @@ echo "[INFO] Setting up symbolic links"
for src in ${(k)linkDots}; do for src in ${(k)linkDots}; do
dest="${linkDots[$src]}" dest="${linkDots[$src]}"
echo "Linking $src to $dest" echo "Linking $src to $dest"
# if [ -d "$src" ]; then if [ -d "$src" ]; then
# test -d $dest && mv $dest $dest.bak test -d $dest && mv $dest $dest.bak
# mkdir -p $dest # mkdir -p $dest
# ln -sf $src $dest ln -sf $src $dest
# elif [ -f "$src" ]; then elif [ -f "$src" ]; then
# dest_parent=$(dirname $dest) dest_parent=$(dirname $dest)
# test -d $dest_parent || mkdir -p $dest_parent test -d $dest_parent || mkdir -p $dest_parent
# ln -sf $src $dest ln -sf $src $dest
# else else
# echo "[ERROR] $src does not exist" echo "[ERROR] $src does not exist"
# fi fi
done done

View file

@ -15,8 +15,10 @@ export DOTFILES
case "$(uname)" in case "$(uname)" in
Linux) Linux)
: :
;;
Darwin) Darwin)
curl https://raw.githubusercontent.com/js0ny/dotfiles/refs/heads/master/bootstrap/macOS/main.zsh -o ~/.local/.tmp/main.zsh curl https://raw.githubusercontent.com/js0ny/dotfiles/refs/heads/master/bootstrap/macOS/main.zsh -o ~/.local/.tmp/main.zsh
zsh ~/.local/.tmp/main.zsh zsh ~/.local/.tmp/main.zsh
rm -rf ~/.local/.tmp/main.zsh rm -rf ~/.local/.tmp/main.zsh
;;
esac esac