Skip to content

Commit

Permalink
Added --update-self
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Apr 19, 2012
1 parent f2aef0a commit 76ec967
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion bin/mad
Expand Up @@ -2,6 +2,7 @@

VERSION="0.3.0"
REMOTE=git@github.com:visionmedia/mad-pages.git
REMOTE_MAD=git@github.com:visionmedia/mad.git
CONFIG=$(dirname $0)/../etc/mad.conf

#
Expand Down Expand Up @@ -77,7 +78,7 @@ install_all_remote() {
local path=/usr/local/share/mad
echo
echo " ... cloning repo"
cd /tmp
cd /tmp && rm -fr mad-pages
git clone --depth 1 $REMOTE mad-pages
cd mad-pages
for page in *.md; do
Expand All @@ -88,6 +89,20 @@ install_all_remote() {
echo
}

#
# Install mad(1) again.
#

install_mad() {
echo
echo " ... cloning repo"
cd /tmp && rm -fr mad
git clone --depth 1 $REMOTE_MAD mad
cd mad && make install
echo " ... updated to $(mad --version)"
echo
}

# file required

test $# -eq 0 && display_mad_usage
Expand All @@ -104,6 +119,9 @@ case $1 in
-u|--update)
install_all_remote
;;
-U|--update-self)
install_mad
;;
*)
display $1
;;
Expand Down

0 comments on commit 76ec967

Please sign in to comment.