From 0d6764c62f123142ab289ce2efb94d4d1126922d Mon Sep 17 00:00:00 2001 From: Varun B Patil Date: Thu, 27 Mar 2014 11:27:59 +0530 Subject: [PATCH] Attempt to change to root dir before executing python script When inside a git repo, attempt to change to the root dir before running python script. Prevents a bunch of errors when mktargets.sh is executed from the wrong dir. --- build/mktargets.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/mktargets.sh b/build/mktargets.sh index 0766e4c8..ceb022ce 100755 --- a/build/mktargets.sh +++ b/build/mktargets.sh @@ -1,4 +1,5 @@ #!/bin/sh +cd "$(git rev-parse --show-toplevel 2>/dev/null)" >/dev/null 2>&1 python build/mktargets.py --directory codec/decoder --library decoder python build/mktargets.py --directory codec/encoder --library encoder --exclude DllEntry.cpp python build/mktargets.py --directory codec/common --library common --exclude asm_inc.asm --exclude arm_arch_common_macro.S @@ -10,3 +11,4 @@ python build/mktargets.py --directory test/encoder --prefix encoder_unittest python build/mktargets.py --directory test/decoder --prefix decoder_unittest python build/mktargets.py --directory test/api --prefix api_test python build/mktargets.py --directory gtest --library gtest --out build/gtest-targets.mk --cpp-suffix .cc --include gtest-all.cc +cd - >/dev/null 2>&1