1
我在Windows 7上使用在Cygwin上运行的bash shell。我在我的bash脚本中试图找出构建文件的位置基于当前执行脚本的位置...通过shell脚本运行ant时无法找到build.xml文件
SCRIPT_DIR="$(cd -P "$(dirname "$0")" && pwd)"
BUILDFILE=$SCRIPT_DIR/build.xml
ant -buildfile $BUILDFILE -Dbuildtarget=$1 -Dmodule="$2" -Dproject=$3 -Dnolabel=true -DFirefox=$4 -DInternetExplorer=$5 -DGoogleChrome=$6 Selenium4
然而,即使该文件是存在的,我得到一个“无法找到构建文件错误”
$ sh c:/selenium//run_client_tests.sh prod "\Critical Path\Live\QX" MyProj true false false
cygwin warning:
MS-DOS style path detected: c:/selenium//run_client_tests.sh
Preferred POSIX equivalent is: /cygdrive/c/selenium/run_client_tests.sh
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Started script
Buildfile: \cygdrive\c\selenium\build.xml does not exist!
Build failed
LS揭示文件是存在的......
[email protected]_w7 /cygdrive/c/selenium
$ ls /cygdrive/c/selenium/build.xml
/cygdrive/c/selenium/build.xml
[email protected]_w7 /cygdrive/c/selenium
$ ls c:/selenium/build.xml
c:/selenium/build.xml
任何你与DOS'清盘机会\ r \ n'脚本文件中的结尾?我不记得,Cygwin是否善意地处理这件事?祝你好运。 – shellter