2011-09-22 3 views
1

Windows 7에서 Cygwin에서 실행중인 bash 쉘을 사용하고 있습니다. 빌드 파일의 위치를 ​​알아 내려고 시도하는 bash 스크립트에이 파일이 있습니다. 쉘 스크립트를 통해 개미를 실행할 때 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 
+0

당신이'DOS와 권선있는 모든 기회를 자바 스타일의 경로를 사용하기 위해 \ r \ n '스크립트 파일의 줄 끝? 나는 기억할 수 없다. Cygwin이 그것을 우아하게 다루고 있는가? 행운을 빕니다. – shellter

답변

2

여기서 문제는 개미가 Cygwin 스타일 경로를 알지 못한다는 것입니다. ant는 \ cygdrive \ c \ selenium \ build.xml을 찾을 수 없다는 불평을합니다. 이는/cygwin이 Cygwin 셸에서만 이해되기 때문입니다.

당신이해야 할 일은 ant에 DOS 스타일 경로를 전달하는 것입니다. 그래서

BUILDFILE=`cygpath -w $SCRIPT_DIR/build.xml` 

BUILDFILE=$SCRIPT_DIR/build.xml 

을 대체 또는이 좀 더 멀티 플랫폼,

BUILDFILE=`cygpath -m $SCRIPT_DIR/build.xml` 
관련 문제