✨ (.zshrc, install.sh): enhance zsh configuration with additional plugin support and improve installation logic for better cross-OS compatibility
This commit is contained in:
36
install_merlin_worker.sh
Normal file
36
install_merlin_worker.sh
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
curl -s https://git.miomio.moe/mio/easyzsh/raw/branch/master/patch.sh | bash -s merlin_worker
|
||||
|
||||
# Check if ~/.bashrc exists and contains PYTHONPATH export
|
||||
if [ -f "$HOME/.bashrc" ]; then
|
||||
# Extract PYTHONPATH from ~/.bashrc (look for export PYTHONPATH=...)
|
||||
BASHRC_PYTHONPATH=$(grep -E "^export PYTHONPATH=" "$HOME/.bashrc" | tail -1)
|
||||
|
||||
if [ -n "$BASHRC_PYTHONPATH" ]; then
|
||||
echo "Found PYTHONPATH in ~/.bashrc: $BASHRC_PYTHONPATH"
|
||||
|
||||
# Path to the merlin_worker.zsh file
|
||||
MERLIN_CONFIG="$HOME/.config/zshrc/merlin_worker.zsh"
|
||||
|
||||
if [ -f "$MERLIN_CONFIG" ]; then
|
||||
# Create a backup
|
||||
cp "$MERLIN_CONFIG" "$MERLIN_CONFIG.backup"
|
||||
|
||||
# Replace the last PYTHONPATH line in merlin_worker.zsh with the one from ~/.bashrc
|
||||
# First, remove existing PYTHONPATH lines
|
||||
sed -i '/^export PYTHONPATH=/d' "$MERLIN_CONFIG"
|
||||
|
||||
# Then append the PYTHONPATH from ~/.bashrc
|
||||
echo "$BASHRC_PYTHONPATH" >> "$MERLIN_CONFIG"
|
||||
|
||||
echo "Updated PYTHONPATH in $MERLIN_CONFIG with value from ~/.bashrc"
|
||||
else
|
||||
echo "Warning: $MERLIN_CONFIG not found"
|
||||
fi
|
||||
else
|
||||
echo "No PYTHONPATH export found in ~/.bashrc"
|
||||
fi
|
||||
else
|
||||
echo "~/.bashrc not found"
|
||||
fi
|
||||
Reference in New Issue
Block a user