From 0aca668c37f645f7b8cdac44d3fb236c8f34196b Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 9 Mar 2022 23:36:23 +0800 Subject: fix theme.load --- xmake/core/base/path.lua | 5 ----- xmake/core/theme/theme.lua | 10 ++++++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/xmake/core/base/path.lua b/xmake/core/base/path.lua index e2fa9e1bc..ede2c36eb 100644 --- a/xmake/core/base/path.lua +++ b/xmake/core/base/path.lua @@ -70,11 +70,6 @@ end -- join path function path.join(p, ...) - print("p", p) - for _, name in ipairs({...}) do - print("1: ", name) - --p = p .. "/" .. name - end return path.translate(p .. path.sep() .. table.concat({...}, path.sep())) end diff --git a/xmake/core/theme/theme.lua b/xmake/core/theme/theme.lua index 60c01ce1c..6ab9c592b 100644 --- a/xmake/core/theme/theme.lua +++ b/xmake/core/theme/theme.lua @@ -115,10 +115,12 @@ function theme.load(name) -- find the theme script path local scriptpath = nil - for _, dir in ipairs(theme.directories()) do - scriptpath = path.join(dir, name, "xmake.lua") - if os.isfile(scriptpath) then - break + if name then + for _, dir in ipairs(theme.directories()) do + scriptpath = path.join(dir, name, "xmake.lua") + if os.isfile(scriptpath) then + break + end end end -- cgit v1.3.1