[Swift-commit] r6177 - trunk/bin

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Tue Jan 29 14:39:26 CST 2013


Author: davidk
Date: 2013-01-29 14:39:26 -0600 (Tue, 29 Jan 2013)
New Revision: 6177

Modified:
   trunk/bin/swiftrun
Log:
Make swiftrun smarter about finding config files for gensites


Modified: trunk/bin/swiftrun
===================================================================
--- trunk/bin/swiftrun	2013-01-29 18:10:02 UTC (rev 6176)
+++ trunk/bin/swiftrun	2013-01-29 20:39:26 UTC (rev 6177)
@@ -65,17 +65,30 @@
    cp $script $rundir
 fi
 
+# Copy config file if specified
+if [ -f "$CONFIG" ]; then
+   cp $CONFIG $rundir
+   CONFIG=$( basename $CONFIG )
+fi
+
 # Create sites.xml
 cd $rundir
 IFS=","
 echo "<config>" > sites.xml
 for site in $SITES
 do
+   # If config is not defined, but there is a config in conf/ that matches, use that
+   if [ -z "$CONFIG" ] && [ -f "../conf/$site.cf" ]; then
+      cp ../conf/$site.cf .
+      CONFIG=$site.cf
+   fi
+
    if [ -f "$CONFIG" ]; then
       gensites -p $CONFIG $site >> sites.xml
    else
       gensites $site >> sites.xml
    fi
+
 done
 echo "</config>" >> sites.xml
 




More information about the Swift-commit mailing list