From 6e4d74bc24554e16b61fc557491e4d514eb4b1e5 Mon Sep 17 00:00:00 2001 From: Brian Daniels Date: Fri, 27 May 2016 12:00:26 -0500 Subject: [PATCH] Fixing issue where project_name was an empty string --- tools/build_api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/build_api.py b/tools/build_api.py index 4394d9aaa9..55bb72df7e 100644 --- a/tools/build_api.py +++ b/tools/build_api.py @@ -22,7 +22,7 @@ import colorama from types import ListType from shutil import rmtree -from os.path import join, exists, basename, abspath +from os.path import join, exists, basename, abspath, normpath from os import getcwd from time import time @@ -96,7 +96,8 @@ def build_project(src_path, build_path, target, toolchain_name, # We need to remove all paths which are repeated to avoid # multiple compilations and linking with the same objects src_paths = [src_paths[0]] + list(set(src_paths[1:])) - project_name = basename(src_paths[0] if src_paths[0] != "." and src_paths[0] != "./" else getcwd()) + first_src_path = src_paths[0] if src_paths[0] != "." and src_paths[0] != "./" else getcwd() + project_name = basename(normpath(first_src_path)) if name is None: # We will use default project name based on project folder name