summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtest/files/script/fact.scala17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/files/script/fact.scala b/test/files/script/fact.scala
index a15c93452c..1ba70dcc6c 100755
--- a/test/files/script/fact.scala
+++ b/test/files/script/fact.scala
@@ -2,7 +2,22 @@
# fact - A simple Scala script that prints out the factorial of
# the argument specified on the command line.
-exec scalascript "$0" "$@"
+cygwin=false;
+case "`uname`" in
+ CYGWIN*) cygwin=true ;;
+esac
+
+SOURCE=$0;
+if $cygwin; then
+ if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then
+ format=mixed
+ else
+ format=windows
+ fi
+ SOURCE=`cygpath --$format "$SOURCE"`;
+fi
+
+exec scalascript $SOURCE "$@"
!#