diff options
Diffstat (limited to 'xmake/plugins/lua/main.lua')
| -rw-r--r-- | xmake/plugins/lua/main.lua | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/xmake/plugins/lua/main.lua b/xmake/plugins/lua/main.lua index 247684e24..7137ea589 100644 --- a/xmake/plugins/lua/main.lua +++ b/xmake/plugins/lua/main.lua @@ -67,12 +67,11 @@ function main() if script_content:startswith("\239\187\191") then script_content = script_content:sub(4) end - import("core.base.tty") - local shell = tty.shell() - if shell == "cmd" or shell == "powershell" or shell == "pwsh" or os.host() == "windows" then + local shell = os.shell() + if shell == "cmd" or shell == "powershell" or shell == "pwsh" or is_host("windows") then script_content = script_content:trim() if script_content:startswith('"') and script_content:endswith('"') then - script_content = script_content:sub(2, -2) + script_content = script_content:trim('\"') end script_content = script_content:replace("\\n", "\n", {plain = true}):replace("\\r", "\r", {plain = true}) end |
