Last active
May 14, 2024 14:26
-
-
Save andrewhenke/f4243b7974fc5dcce948df67c1d6f914 to your computer and use it in GitHub Desktop.
Script to auto-import and configure the bash aliases given at https://andrewhenke.com/bash-aliases-to-make-your-life-easier/
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 characters
#!/bin/bash | |
FILE="$HOME/.bash_aliases" | |
if [ -f "$FILE" ]; then | |
echo "Bash Aliases file detected - backing up" | |
mv "$FILE" "${FILE}.bak" | |
echo "Backup created: ${FILE}.bak" | |
else | |
echo "Bash Aliases file does not exist, proceeding" | |
fi | |
echo "Downloading aliases..." | |
wget -q -O "$FILE" "https://gist.github.com/andrewhenke/0c1ff2858e776ce10fca9cb5d65828e8/raw/" | |
if [ -f "$FILE" ]; then | |
echo "File downloaded successfully to $FILE" | |
echo "Sourcing $FILE" | |
source "$FILE" | |
echo "Aliases Added" | |
else | |
echo "Failed to download file." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment