aboutsummaryrefslogtreecommitdiff
path: root/run-example
diff options
context:
space:
mode:
authorJosh Rosen <joshrosen@apache.org>2013-12-15 18:39:30 -0800
committerJosh Rosen <joshrosen@apache.org>2013-12-15 18:51:31 -0800
commitf8ba89da217a1f1fd5c856a95a27a3e535017643 (patch)
tree746c7e73e63aed04303a3c17da64ccde959b6366 /run-example
parentd2ced6d58c5e8aea23f909c2fc4ac11aa1b55607 (diff)
downloadspark-f8ba89da217a1f1fd5c856a95a27a3e535017643.tar.gz
spark-f8ba89da217a1f1fd5c856a95a27a3e535017643.tar.bz2
spark-f8ba89da217a1f1fd5c856a95a27a3e535017643.zip
Fix Cygwin support in several scripts.
This allows the spark-shell, spark-class, run-example, make-distribution.sh, and ./bin/start-* scripts to work under Cygwin. Note that this doesn't support PySpark under Cygwin, since that requires many additional `cygpath` calls from within Python and will be non-trivial to implement. This PR was inspired by, and subsumes, #253 (so close #253 after this is merged).
Diffstat (limited to 'run-example')
-rwxr-xr-xrun-example10
1 files changed, 10 insertions, 0 deletions
diff --git a/run-example b/run-example
index feade6589a..a78192d31d 100755
--- a/run-example
+++ b/run-example
@@ -17,6 +17,11 @@
# limitations under the License.
#
+cygwin=false
+case "`uname`" in
+ CYGWIN*) cygwin=true;;
+esac
+
SCALA_VERSION=2.10
# Figure out where the Scala framework is installed
@@ -59,6 +64,11 @@ fi
CLASSPATH=`$FWDIR/bin/compute-classpath.sh`
CLASSPATH="$SPARK_EXAMPLES_JAR:$CLASSPATH"
+if $cygwin; then
+ CLASSPATH=`cygpath -wp $CLASSPATH`
+ export SPARK_EXAMPLES_JAR=`cygpath -w $SPARK_EXAMPLES_JAR`
+fi
+
# Find java binary
if [ -n "${JAVA_HOME}" ]; then
RUNNER="${JAVA_HOME}/bin/java"