Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 34 lines (29 sloc) 666 Bytes
#!/bin/bash
clear
if [ $# -ne 1 ]; then
echo "Please specify commit message"
exit
fi
# Show what we'll do
git status
read -p "Add all and publish as : $1 ?"
# Clean the published dir
if [ -d "ThinkLoveShare.github.io/.git" ]; then
/bin/rm -rf ThinkLoveShare.github.io/* # Keeps the .git
else
git clone git@github.com:ThinkLoveShare/ThinkLoveShare.github.io.git
/bin/rm -rf ThinkLoveShare.github.io/* # Keeps the .git
fi
# Generate static files
hugo -d ThinkLoveShare.github.io/
git add .
git status
read -p "Still sure ?"
git commit -a -m "$1"
git push
# Publish the site
pushd ThinkLoveShare.github.io/
git add .
git commit -a -m "$1"
git push
popd
You can’t perform that action at this time.