check and get dir by $PWD for Windows builds under Cygwin
authorFrederick Zhang <Frederick888@Tsundere.moe>
Wed, 26 Aug 2015 18:54:55 +0000 (02:54 +0800)
committerFrederick Zhang <Frederick888@Tsundere.moe>
Wed, 26 Aug 2015 18:58:42 +0000 (02:58 +0800)
src/etc/cargo.bashcomp.sh

index 21cea0cae9c1378ea0714421f79cd056c25b904b..2d8a421a6cfda735a62a79963513773832c98e63 100644 (file)
@@ -100,7 +100,12 @@ _get_examples(){
 }
 
 _get_targets(){
-       local CURRENT_PATH=$(_locate_manifest)
+       local CURRENT_PATH
+       if [ `uname -o` == "Cygwin" -a -f "$PWD"/Cargo.toml ]; then
+               CURRENT_PATH=$PWD
+       else
+               CURRENT_PATH=$(_locate_manifest)
+       fi
        if [[ -z "$CURRENT_PATH" ]]; then
                return 1
        fi