[Swift-commit] r6862 - SwiftTutorials/CIC_2013-08-09

wilde at ci.uchicago.edu wilde at ci.uchicago.edu
Thu Aug 15 11:17:36 CDT 2013


Author: wilde
Date: 2013-08-15 11:17:36 -0500 (Thu, 15 Aug 2013)
New Revision: 6862

Modified:
   SwiftTutorials/CIC_2013-08-09/setup.sh
Log:
for cic

Modified: SwiftTutorials/CIC_2013-08-09/setup.sh
===================================================================
--- SwiftTutorials/CIC_2013-08-09/setup.sh	2013-08-15 16:17:10 UTC (rev 6861)
+++ SwiftTutorials/CIC_2013-08-09/setup.sh	2013-08-15 16:17:36 UTC (rev 6862)
@@ -1,3 +1,51 @@
+# ensure that this script is being sourced
+
+if [ ${BASH_VERSINFO[0]} -gt 2 -a "${BASH_SOURCE[0]}" = "${0}" ] ; then
+  echo ERROR: script ${BASH_SOURCE[0]} must be executed as: source ${BASH_SOURCE[0]}
+fi
+
+# Setting scripts folder to the PATH env var.
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+echo Adding $DIR to PATH:
+PATH=$DIR/bin:$DIR/app:$PATH
+
+# Setting .swift files
+
+if [ -e $HOME/.swift ]; then
+  savedotswift=$(mktemp -d $HOME/.swift.save.XXXX)
+  echo Saving $HOME/.swift in $savedotswift
+  mv $HOME/.swift/* $savedotswift
+else
+  mkdir -p $HOME/.swift
+fi
+
+cat >>$HOME/.swift/swift.properties <<END
+
+# Properties for Swift Tutorial
+
+sites.file=sites.xml
+tc.file=apps
+
+wrapperlog.always.transfer=true
+sitedir.keep=true
+file.gc.enabled=false
+status.mode=provider
+
+execution.retries=0
+lazy.errors=false
+
+use.wrapper.staging=false
+use.provider.staging=true
+provider.staging.pin.swiftfiles=false
+
+END
+
+
+return
+
+# OLD, to remove:
+
 #The following line sets the default site
 site="uc3"
 
@@ -34,38 +82,3 @@
 echo "Site selected : $site"
 site_setup $site
 
-
-# Setting scripts folder to the PATH env var.
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-echo Adding $DIR to PATH:
-PATH=$DIR:$PATH
-
-# Setting .swift files
-if [ -e $HOME/.swift ]; then
-  savedotswift=$(mktemp -d $HOME/.swift.save.XXXX)
-  echo Saving $HOME/.swift in $savedotswift
-  mv $HOME/.swift/* $savedotswift
-else
-  mkdir -p $HOME/.swift
-fi
-
-cat >>$HOME/.swift/swift.properties <<END
-
-# Properties for Swift Tutorial
-
-sites.file=sites.xml
-tc.file=apps
-
-wrapperlog.always.transfer=true
-sitedir.keep=true
-file.gc.enabled=false
-status.mode=provider
-
-execution.retries=0
-lazy.errors=false
-
-use.wrapper.staging=false
-use.provider.staging=true
-provider.staging.pin.swiftfiles=true
-
-END




More information about the Swift-commit mailing list