summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaikari <[email protected]>2026-02-02 09:24:43 +0300
committerGitHub <[email protected]>2026-02-02 09:24:43 +0300
commit8a6b95da91feb273b1ad151fb2d0dbf57b3475b0 (patch)
tree523e0c5518b0592657bedff36eaf48264d4eef28
parent5e885b512315064825a96fa4865707adae9ab7ed (diff)
Refactor BOM removal in script input handling
-rw-r--r--xmake/plugins/lua/main.lua4
1 files changed, 1 insertions, 3 deletions
diff --git a/xmake/plugins/lua/main.lua b/xmake/plugins/lua/main.lua
index 988f2af1f..261dffaa0 100644
--- a/xmake/plugins/lua/main.lua
+++ b/xmake/plugins/lua/main.lua
@@ -50,9 +50,7 @@ function _get_script_from_stdin()
local script_content = io.read("*a")
if script_content then
-- remove utf8 bom
- if script_content:startswith(utf8.bom) then
- script_content = script_content:sub(#utf8.bom + 1)
- end
+ script_content = script_content:ltrim(utf8.bom)
local shell = os.shell()
if shell == "cmd" or shell == "powershell" or shell == "pwsh" or is_host("windows") then
script_content = script_content:trim()