[tools] --project-name= can use name with space

This commit is contained in:
Meco Man 2023-07-23 18:07:30 -04:00
parent 86f127311d
commit 65238275ac
2 changed files with 3 additions and 3 deletions

View File

@ -959,7 +959,7 @@ def EndBuilding(target, program = None):
if not isinstance(project_path, str) or len(project_path) == 0 : if not isinstance(project_path, str) or len(project_path) == 0 :
project_path = os.path.join(BSP_ROOT, 'rt-studio-project') project_path = os.path.join(BSP_ROOT, 'rt-studio-project')
MkDist(program, BSP_ROOT, Rtt_Root, Env, project_name, project_path) MkDist(program, BSP_ROOT, Rtt_Root, Env, project_name, project_path)
child = subprocess.Popen('scons --target=eclipse --project-name=' + project_name, cwd=project_path, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) child = subprocess.Popen('scons --target=eclipse --project-name="{}"'.format(project_name), cwd=project_path, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
stdout, stderr = child.communicate() stdout, stderr = child.communicate()
need_exit = True need_exit = True
if GetOption('cscope'): if GetOption('cscope'):

View File

@ -376,13 +376,13 @@ def MkDist(program, BSP_ROOT, RTT_ROOT, Env, project_name, project_path):
target_project_type = GetOption('target') target_project_type = GetOption('target')
if target_project_type: if target_project_type:
child = subprocess.Popen('scons --target={} --project-name={}'.format(target_project_type, project_name), cwd=dist_dir, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) child = subprocess.Popen('scons --target={} --project-name="{}"'.format(target_project_type, project_name), cwd=dist_dir, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
stdout, stderr = child.communicate() stdout, stderr = child.communicate()
if child.returncode == 0: if child.returncode == 0:
print(stdout) print(stdout)
else: else:
print(stderr) print(stderr)
else: else:
print('suggest to use command scons --dist [--target=xxx] [--project-name=xxx] [--project-path=xxx]') print('suggest to use command scons --dist [--target=xxx] [--project-name="xxx"] [--project-path="xxx"]')
print('dist project successfully!') print('dist project successfully!')