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