Skip to content

Instantly share code, notes, and snippets.

@benwiz
Last active January 3, 2019 02:00
Show Gist options
  • Save benwiz/872178b2a09c520d4d7eb1b6a659f1a1 to your computer and use it in GitHub Desktop.
Save benwiz/872178b2a09c520d4d7eb1b6a659f1a1 to your computer and use it in GitHub Desktop.
TARGET_DIR="$HOME/code/bash_configs"
# Copy .bashrc to general git repo
cp "$HOME/.bashrc" "$TARGET_DIR/bashrc"
# Copy .bash_profile to general git repo
cp "$HOME/.bash_profile" "$TARGET_DIR/bash_profile"
# Copy .bash_alias to general git repo
cp "$HOME/.bash_alias" "$TARGET_DIR/bash_alias"
# commit and push change
git --git-dir="$TARGET_DIR/.git/" --work-tree="$TARGET_DIR/" add bash_alias bash_profile bashrc
git --git-dir="$TARGET_DIR/.git/" --work-tree="$TARGET_DIR/" commit -m 'cronjob auto commit'
git --git-dir="$TARGET_DIR/.git/" --work-tree="$TARGET_DIR/" push
# TODO: Only show notification is push was a success
# display notification center alert
osascript -e 'display notification "Saved .bashrc, .bash_profile, .bash_alias" with title "Cronjob"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment