我正按照说明instructions尝试安装播放框架 但是我没有成功执行播放脚本,即安装文件。
到目前为止我做了什么:
chmod a+x ./play
是否授予脚本权限,我甚至chmod a+x play-2.0.4
整个目录但是我收到了这个错误:
File "./play", line 4
while [ -h "$PRG" ] ; do
^
SyntaxError: invalid syntax
所以我的问题是: 为什么会出现这种语法错误,脚本似乎不可能出现语法错误?
仅供参考,这是整个脚本:
done
dir=`dirname $PRG`
if [ -f conf/application.conf ]; then
if test "$1" = "clean-all"; then
rm -rf target
rm -rf tmp
rm -rf logs
rm -rf dist
rm -rf project/project
rm -rf project/target
if [ $# -ne 1 ]
then
shift
else
echo "[info] Done!"
exit 0
fi
fi
if test "$1" = "stop"; then
if [ -f RUNNING_PID ]; then
echo "[info] Stopping application (with PID `cat RUNNING_PID`)..."
kill `cat RUNNING_PID`
RESULT=$?
if test "$RESULT" = 0; then
echo "[info] Done!"
exit 0
else
echo "[\033[31merror\033[0m] Failed ($RESULT)"
exit $RESULT
fi
else
echo "[\033[31merror\033[0m] No RUNNING_PID file. Is this application running?"
exit 1
fi
fi
if test "$1" = "debug"; then
JPDA_PORT="9999"
shift
fi
if [ -n "$1" ]; then
JPDA_PORT="${JPDA_PORT}" $dir/framework/build "$@"
else
JPDA_PORT="${JPDA_PORT}" $dir/framework/build play
fi
else
java -Dsbt.ivy.home=$dir/repository -Dplay.home=$dir/framework -Dsbt.boot.properties=$dir/framework/sbt/play.boot.properties -jar $dir/framework/sbt/sbt-launch.jar "$@"
fi
提前谢谢!
答案 0 :(得分:0)
您正在尝试使用Python运行shell脚本,这将无法运行。
尽管Play版本1使用了Python,但版本2已改为使用shell脚本。