qsos-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qsos-commits] qsos/tools/update_sheet update_sheet.sh


From: Goneri Le Bouder
Subject: [Qsos-commits] qsos/tools/update_sheet update_sheet.sh
Date: Sat, 31 Mar 2007 01:57:05 +0000

CVSROOT:        /sources/qsos
Module name:    qsos
Changes by:     Goneri Le Bouder <goneri>       07/03/31 01:57:05

Modified files:
        tools/update_sheet: update_sheet.sh 

Log message:
        Do not remove LOCAL_DIR_SHEETS and LOCAL_DIR_TEMPLATES anymore

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qsos/tools/update_sheet/update_sheet.sh?cvsroot=qsos&r1=1.12&r2=1.13

Patches:
Index: update_sheet.sh
===================================================================
RCS file: /sources/qsos/qsos/tools/update_sheet/update_sheet.sh,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- update_sheet.sh     26 Mar 2007 11:11:27 -0000      1.12
+++ update_sheet.sh     31 Mar 2007 01:57:05 -0000      1.13
@@ -1,5 +1,6 @@
-#$Id: update_sheet.sh,v 1.12 2007/03/26 11:11:27 goneri Exp $
-#  Copyright (C) 2006 Atos Origin 
+#!/bin/sh
+#$Id: update_sheet.sh,v 1.13 2007/03/31 01:57:05 goneri Exp $
+#  Copyright (C) 2006 2007 Atos Origin 
 #
 #  Author: Gonéri Le Bouder <address@hidden>
 #
@@ -20,6 +21,7 @@
 #  This script checkout current sheet from the CVS, translate them
 #  to xhtml and upload them on a ftp server
 set -e
+
 . qsos.cfg || exit 1
 
 createSheet () {
@@ -91,11 +93,9 @@
   sed s!%%DIRECTORY%%!"$DIR"! \
   > $DIR/index.html
 
-
-
   echo index $DIR/index.html created
-
 }
+
 # FIXME if mkdir failed, web site is removed...
 upload () {
 cat <<eof | lftp
@@ -112,10 +112,13 @@
 }
 
 deploy_local () {
-rm -rf $LOCAL_DIR_SHEETS
-rm -rf $LOCAL_DIR_TEMPLATES
-mkdir -p $LOCAL_DIR_SHEETS
-mkdir -p $LOCAL_DIR_TEMPLATES
+if [ ! -d $LOCAL_DIR_SHEETS ] || [ ! -d $LOCAL_DIR_TEMPLATES ]; then
+  echo "LOCAL_DIR_SHEETS and LOCAL_DIR_TEMPLATES must exist"
+  exit 1
+fi
+
+rm -rf $LOCAL_DIR_SHEETS/*
+rm -rf $LOCAL_DIR_TEMPLATES/*
 cp -rv $DESTDIR_SHEETS/* $LOCAL_DIR_SHEETS
 cp -rv $DESTDIR_TEMPLATES/* $LOCAL_DIR_TEMPLATES
 }
@@ -145,7 +148,6 @@
 done
 
 createIndex "template" $DESTDIR_TEMPLATES 
-
 if [ "$FTP_UPLOAD" = "yes" ]
 then
   upload




reply via email to

[Prev in Thread] Current Thread [Next in Thread]