Last active
May 23, 2016 18:12
-
-
Save arwer13/b9ad9853f2ea7d5bac991128e4502958 to your computer and use it in GitHub Desktop.
This file contains 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 | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $0 <site name> <url> <description>" | |
exit 1 | |
fi | |
LINKS_MD_PATH="/home/user/repo/links.md" | |
REPO_DIR="$(dirname $LINKS_MD_PATH)" | |
NAME=$1 | |
URL=$2 | |
DESCRIPTION=$3 | |
echo "- [$NAME]($URL). $DESCRIPTION" >> "$LINKS_MD_PATH" | |
cd "$REPO_DIR" | |
git commit -am "add new website link" | |
git push | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment