Check environment by verifying other dirs' existence

Signed-off-by: Yuto Takano <yuto.takano@arm.com>
This commit is contained in:
Yuto Takano 2021-08-06 16:40:30 +01:00
parent 201f9e85ca
commit 5939a2a4de

View File

@ -162,11 +162,10 @@ class NameCheck(object):
Check that the current working directory is the project root, and throw Check that the current working directory is the project root, and throw
an exception if not. an exception if not.
""" """
current_dir = os.path.realpath('.') if (not os.path.isdir("include") or
root_dir = os.path.dirname(os.path.dirname( not os.path.isdir("tests") or
os.path.dirname(os.path.realpath(__file__)))) not os.path.isdir("library")):
if current_dir != root_dir: raise Exception("This script must be run from Mbed TLS root")
raise Exception("Must be run from Mbed TLS root")
def get_files(self, extension, directory): def get_files(self, extension, directory):
""" """