Skip to content

Commit ea75800

Browse files
judecumtmysterywolf
authored andcommitted
[tools] use project's dir basename as default project name
1 parent 0468686 commit ea75800

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.github/workflows/action_tools.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
if: ${{ success() }}
7878
run: |
7979
echo "Test to dist project"
80-
scons --dist -C $TEST_BSP_ROOT
80+
scons --dist --project-name=project -C $TEST_BSP_ROOT
8181
scons --dist-ide -C $TEST_BSP_ROOT
8282
ls $TEST_BSP_ROOT
8383
ls $TEST_BSP_ROOT/dist

tools/options.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
# 2022-04-20 WuGensheng Add Options to SCons
2323
#
2424

25-
from SCons.Script import AddOption
25+
from SCons.Script import AddOption, Dir
2626
import platform
27+
import os
2728

2829
def AddOptions():
2930
''' ===== Add generic options to SCons ===== '''
@@ -45,7 +46,7 @@ def AddOptions():
4546
AddOption('--project-name',
4647
dest = 'project-name',
4748
type = 'string',
48-
default = "project",
49+
default = os.path.basename(Dir('#').abspath),
4950
help = 'set project name')
5051
AddOption('--cscope',
5152
dest = 'cscope',

0 commit comments

Comments
 (0)