Fix the erlang tutorial

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1071148 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/tutorial/erl/server.sh b/tutorial/erl/server.sh
index 106c89e..775afb6 100755
--- a/tutorial/erl/server.sh
+++ b/tutorial/erl/server.sh
@@ -26,12 +26,12 @@
     exit 1
 fi
 
-if ! [ -d ../gen-erl ]; then
-    echo "Please run thrift first to generate ../gen-erl/"
-    exit 1
+if ! [ -d gen-erl ]; then
+  ../../compiler/cpp/thrift -r --gen erl ../tutorial.thrift
 fi
 
 
-erlc -I ${ERL_THRIFT}/include -I ../gen-erl -o ../gen-erl ../gen-erl/*.erl  &&
-  erlc -I ${ERL_THRIFT}/include -I ../gen-erl *.erl &&
-  erl +K true -pa ${ERL_THRIFT}/ebin -pa ../gen-erl 
+erlc -I ${ERL_THRIFT}/include -I ${ERL_THRIFT}/ebin \
+     -I gen-erl -o gen-erl gen-erl/*.erl &&
+  erlc -I ${ERL_THRIFT}/include -I gen-erl *.erl &&
+  erl +K true -pa ${ERL_THRIFT}/ebin -pa gen-erl