Created
January 22, 2014 00:14
-
-
Save mariolopjr/8551160 to your computer and use it in GitHub Desktop.
Automates pushing the Octopress source, just do "push Commit message" and the script will do the rest!
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 | |
# | |
# push.sh | |
# | |
# Mario Lopez (http://techsym.com) @cubanresourceful | |
# Use and modify freely, attribution appreciated | |
# | |
# Generates and deploys an Octopress instance for you. | |
# | |
# Usage | |
# $ push Message of commit | |
# | |
# NOTE: Do not wrap the parameters in quotes | |
# | |
# | |
# Variables | |
# | |
# Name of the branch that will receive the source code | |
StrBranchName="source" | |
# Location to your Octopress source | |
StrOctopressSource="$HOME/Documents/Projects/techsym.com/octopress/source" | |
# Name of the Git Remote Server | |
StrRemoteName="origin" | |
# | |
# Script Execution | |
# | |
# Change to the directory that houses your Octopress source | |
cd $StrOctopressSource | |
# Sets the commit message based upon the input args | |
StrCommitMessage="$@" | |
# Executes git commands | |
git add . | |
git commit -m "$StrCommitMessage" | |
git push $StrRemoteName $StrBranchName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment