File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,15 @@ function main()
3232 os .cd (os .projectdir ())
3333 -- print("project file: " .. project.rootfile())
3434
35- if command == " list" then
35+ if command == " init" then
36+ local d2x_json_file = path .join (os .projectdir (), " .d2x.json" )
37+ if os .isfile (d2x_json_file ) then
38+ local d2x_config = json .loadfile (d2x_json_file ) or {}
39+ if d2x_config [" lang" ] then
40+ os .exec (" xmake f --lang=" .. d2x_config [" lang" ])
41+ end
42+ end
43+ elseif command == " list" then
3644 list ()
3745 elseif command == " build" then
3846 os .exec (" xmake build " .. (target or " " ))
Original file line number Diff line number Diff line change @@ -4,10 +4,11 @@ if is_host("windows") then
44 add_ldflags (" -static" )
55end
66
7- local lang = " en"
8- if d2x and d2x .private and d2x .private .mcpp then
9- lang = d2x .private .mcpp .lang or " en"
10- end
7+ option (" lang" )
8+ set_default (" en" )
9+ set_description (" Language: en or zh" )
10+
11+ local lang = get_config (" lang" )
1112
1213if lang == " zh" then
1314
You can’t perform that action at this time.
0 commit comments