Skip to content
Browse files

Changed doc script to support target dir argument

  • Loading branch information...
1 parent a5192d5 commit b2c3b1ff0d341c4121964e63706f4bb964b9f7a3 @labisso labisso committed Dec 29, 2009
Showing with 30 additions and 6 deletions.
  1. +5 −1 docs/README.txt
  2. +25 −5 docs/scripts/push_to_mcs_web.sh
View
6 docs/README.txt
@@ -15,4 +15,8 @@ To locally view docs, run build-and-serve-locally.sh and then open your web
browser to the URL printed out.
To push docs to the live site, run push_to_mcs_web.sh. You must be on an MCS
-shell (with access to /mcs/ filesystem).
+shell (with access to /mcs/ filesystem). By default this script will drop
+docs in the dev/ subdirectory of the docs section of the site. You can
+supply an argument to have it go somewhere else. Like:
+ push_to_mcs_web.sh foo/
+
View
30 docs/scripts/push_to_mcs_web.sh
@@ -6,8 +6,28 @@ DOCROOTDIR=$(dirname $SCRIPTDIR)
TEMPDIR=$DOCROOTDIR/tmp
+# group to chown everything to
+UNIXGROUP="vwtools"
+
# final output DIR:
-BASE="/mcs/ee.mcs.anl.gov/nimbus/doc/2.2/"
+BASE="/mcs/ee.mcs.anl.gov/nimbus/doc"
+
+if [ ! -d "$BASE" ]; then
+ echo "Base directory '$BASE' does not exist."
+ exit 1
+fi
+
+TARGET=""
+if [ $# = 1 ]; then
+ TARGET="$BASE/$1"
+else
+ TARGET="$BASE/dev/"
+fi
+
+if [ ! -d "$TARGET" ]; then
+ echo "Target directory '$TARGET' does not exist."
+ exit 1
+fi
echo ""
echo "================="
@@ -24,17 +44,17 @@ echo "=================="
echo ""
# use checksums only for comparison
-rsync -crlv $DOCROOTDIR/html/ $BASE/
+rsync -crlv $DOCROOTDIR/html/ $TARGET/
echo ""
echo "====================="
echo "| Group permissions |"
echo "====================="
echo ""
-find $BASE -exec chown :vwtools {} \;
-find $BASE -type d -exec chmod 775 {} \;
-find $BASE -type f -exec chmod 664 {} \;
+find $TARGET -exec chown :$UNIXGROUP {} \;
+find $TARGET -type d -exec chmod 775 {} \;
+find $TARGET -type f -exec chmod 664 {} \;
echo ""
echo "Done."

0 comments on commit b2c3b1f

Please sign in to comment.
Something went wrong with that request. Please try again.