Skip to content

Instantly share code, notes, and snippets.

@andrewhenke
Last active May 14, 2024 14:26
Show Gist options
  • Save andrewhenke/f4243b7974fc5dcce948df67c1d6f914 to your computer and use it in GitHub Desktop.
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/
#!/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