Created
March 21, 2025 02:09
-
-
Save hongsw/39552ac7807bdac2f025f3b84951a4f4 to your computer and use it in GitHub Desktop.
Revisions
-
hongsw created this gist
Mar 21, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ #!/bin/bash # Create backup filename with current date and time BACKUP_FILE=~/.zshrc.backup.$(date +%Y%m%d%H%M%S) # Backup original file cp ~/.zshrc "$BACKUP_FILE" echo "Existing .zshrc file has been backed up to $BACKUP_FILE" # Remove existing ASDF-related settings and create new file grep -v "asdf\|ASDF_DATA_DIR" ~/.zshrc > ~/.zshrc.new # Add new ASDF settings echo 'export ASDF_DATA_DIR="$HOME/.asdf" && export PATH="$ASDF_DATA_DIR/shims:$HOME/bin:$PATH"' >> ~/.zshrc.new # Replace original file mv ~/.zshrc.new ~/.zshrc # Output changes echo -e "\nChanges made:" diff "$BACKUP_FILE" ~/.zshrc echo -e "\nSetup complete. Run 'source ~/.zshrc' or open a new terminal to apply changes."