Permalink
Browse files

Added --update-self

  • Loading branch information...
1 parent f2aef0a commit 76ec9674ab3e9f3e402ec186c3767153d281755b @tj committed Apr 19, 2012
Showing with 19 additions and 1 deletion.
  1. +19 −1 bin/mad
View
20 bin/mad
@@ -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
#
@@ -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
@@ -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
@@ -104,6 +119,9 @@ case $1 in
-u|--update)
install_all_remote
;;
+ -U|--update-self)
+ install_mad
+ ;;
*)
display $1
;;

0 comments on commit 76ec967

Please sign in to comment.