diff options
| author | ruki <[email protected]> | 2026-02-06 10:42:19 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-06 10:42:19 +0800 |
| commit | 2786adcbd1dfd44a3a2dc5f652abc2fc11241403 (patch) | |
| tree | 5109f2e7cf4b6137c06b16763c0cdc73393d5c3b | |
| parent | 095d5034b4cba62e7476d2b09e7a9a6a19d27255 (diff) | |
Refactor os.execv calls for better readability
| -rw-r--r-- | xmake/actions/run/main.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/xmake/actions/run/main.lua b/xmake/actions/run/main.lua index db1ccef3b..effaa8e45 100644 --- a/xmake/actions/run/main.lua +++ b/xmake/actions/run/main.lua @@ -40,16 +40,18 @@ function _run_wasm_target_in_browser(targetfile, opt) local setenvs = opt.setenvs local emrun = find_tool("emrun") if emrun then - os.execv(emrun.program, {targetfile}, {curdir = rundir, detach = option.get("detach"), addenvs = addenvs, setenvs = setenvs}) + os.execv(emrun.program, {targetfile}, { + curdir = rundir, detach = option.get("detach"), addenvs = addenvs, setenvs = setenvs}) else local python = find_tool("python3") if not python then raise("emrun or python not found, which is required for running wasm target in browser!") end - local url = "http://localhost:8000/" .. path.relative(targetfile, rundir):gsub("\\", "/") + local url = "http://localhost:8000/" .. path.unix(path.relative(targetfile, rundir)) print("please open the url in browser") cprint("${color.success}%s${clear}", url) - os.execv(python.program, {"-m", "http.server", "--bind", "127.0.0.1", "8000"}, {curdir = rundir, detach = option.get("detach"), addenvs = addenvs, setenvs = setenvs}) + os.execv(python.program, {"-m", "http.server", "--bind", "127.0.0.1", "8000"}, { + curdir = rundir, detach = option.get("detach"), addenvs = addenvs, setenvs = setenvs}) end end |
