diff --git a/.travis.yml b/.travis.yml
index 33b8576a7bf680fa0530bb381f3165b4ea20df49..88ad5d63cb89e3ce541e7bdee9dae5ddd8a642a9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,10 +1,10 @@
 language: cpp
 
 before_install:
-  - cd .. && ./ardupilot/Tools/scripts/install-prereqs-ubuntu.sh -y && . ~/.profile
+  -  APMDIR=$(pwd) && pushd .. && $APMDIR/Tools/scripts/install-prereqs-ubuntu.sh -y && . ~/.profile && popd
 
 script: 
-  - cd ./ardupilot && Tools/scripts/build_all_travis.sh
+  - Tools/scripts/build_all_travis.sh
 
 notifications:
   webhooks: