From 77a276abe8281ac3b9892ecbc5d21c66c22801c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 8 Jul 2021 15:59:23 +0800 Subject: ignore case in Windows --- script/library.lua | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'script') diff --git a/script/library.lua b/script/library.lua index 21004ab6..3d52baea 100644 --- a/script/library.lua +++ b/script/library.lua @@ -259,6 +259,17 @@ local function loadSingle3rdConfig(libraryDir) cfg[k] = v end + if cfg.files then + for i, filename in ipairs(cfg.files) do + if plat.OS == 'Windows' then + filename = filename:lower():gsub('/', '\\') + else + filename = filename:gsub('\\', '/') + end + cfg.files[i] = filename + end + end + return cfg end @@ -361,9 +372,6 @@ local function check3rdByFileName(uri, configs) if cfg.files then for _, filename in ipairs(cfg.files) do await.delay() - if plat.OS == 'Windows' then - filename = filename:lower() - end if path:match(filename) then askFor3rd(cfg) return -- cgit v1.2.3