Skip to content

Instantly share code, notes, and snippets.

@emtudo
Last active July 4, 2016 17:59
Show Gist options
  • Save emtudo/24fd0a61210ec58af48b3a565ff9ebe1 to your computer and use it in GitHub Desktop.
Save emtudo/24fd0a61210ec58af48b3a565ff9ebe1 to your computer and use it in GitHub Desktop.
Auto Sync github
#!/bin/bash
cd /path/autosync
if [ ! -z "$1" ]; then
if [ -d $1 ] && [ $1 != "." ]; then
cd "$1"
pwd
git pull
fi
exit 0
fi
file=$0
start=$(echo ${0} | cut -c1-1)
if [ "$start" != "." ] && [ "$start" != "/" ]; then
file="./$0"
fi
find -maxdepth 1 -exec "$file" {} \;
exit 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment