mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
fix(bootstrap): Fix macOS script
This commit is contained in:
parent
d9aa8fafdb
commit
041a509481
4 changed files with 34 additions and 18 deletions
|
|
@ -1,14 +1,19 @@
|
|||
echo "[INFO] ZDOTDIR = $ZDOTDIR"
|
||||
echo "[INFO] DOTFILES = $DOTFILES"
|
||||
|
||||
echo "[ACTION] Press any key to proceed"
|
||||
read -n 1 -s -r
|
||||
# echo "[ACTION] Press any key to proceed"
|
||||
# read -n 1 -s -r
|
||||
|
||||
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/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"
|
||||
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
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@ echo "[ACTION] Request Human Takeover"
|
|||
xcode-select --install
|
||||
|
||||
# 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
|
||||
# Installation Sources
|
||||
|
|
@ -29,7 +30,9 @@ echo "[INFO] Installing Homebrew"
|
|||
echo "[ACTION] Request Human Input"
|
||||
/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"
|
||||
|
||||
|
|
@ -45,6 +48,10 @@ echo "[INFO] Installing Homebrew Packages"
|
|||
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||
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
|
||||
|
||||
source $DOTFILES/bootstrap/macOS/duti.zsh
|
||||
|
|
@ -62,10 +69,12 @@ source $DOTFILES/tools/zsh/zshrc
|
|||
|
||||
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
|
||||
|
||||
just set_remote
|
||||
just init
|
||||
# just install_rime
|
||||
## Rime is installed via Brewfile
|
||||
just clone_plum
|
||||
|
||||
echo "[INFO] Installing Doom Emacs"
|
||||
|
|
|
|||
|
|
@ -16,15 +16,15 @@ echo "[INFO] Setting up symbolic links"
|
|||
for src in ${(k)linkDots}; do
|
||||
dest="${linkDots[$src]}"
|
||||
echo "Linking $src to $dest"
|
||||
# if [ -d "$src" ]; then
|
||||
# test -d $dest && mv $dest $dest.bak
|
||||
# mkdir -p $dest
|
||||
# ln -sf $src $dest
|
||||
# elif [ -f "$src" ]; then
|
||||
# dest_parent=$(dirname $dest)
|
||||
# test -d $dest_parent || mkdir -p $dest_parent
|
||||
# ln -sf $src $dest
|
||||
# else
|
||||
# echo "[ERROR] $src does not exist"
|
||||
# fi
|
||||
if [ -d "$src" ]; then
|
||||
test -d $dest && mv $dest $dest.bak
|
||||
# mkdir -p $dest
|
||||
ln -sf $src $dest
|
||||
elif [ -f "$src" ]; then
|
||||
dest_parent=$(dirname $dest)
|
||||
test -d $dest_parent || mkdir -p $dest_parent
|
||||
ln -sf $src $dest
|
||||
else
|
||||
echo "[ERROR] $src does not exist"
|
||||
fi
|
||||
done
|
||||
|
|
|
|||
|
|
@ -15,8 +15,10 @@ export DOTFILES
|
|||
case "$(uname)" in
|
||||
Linux)
|
||||
:
|
||||
;;
|
||||
Darwin)
|
||||
curl https://raw.githubusercontent.com/js0ny/dotfiles/refs/heads/master/bootstrap/macOS/main.zsh -o ~/.local/.tmp/main.zsh
|
||||
zsh ~/.local/.tmp/main.zsh
|
||||
rm -rf ~/.local/.tmp/main.zsh
|
||||
;;
|
||||
esac
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue