From 310fb6033315245681b620a317f9f21a9897ee00 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, 20 Oct 2022 16:41:15 +0800 Subject: only search real uri in Windows --- script/files.lua | 3 +++ script/filewatch.lua | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/script/files.lua b/script/files.lua index e645cd83..604afa99 100644 --- a/script/files.lua +++ b/script/files.lua @@ -73,6 +73,9 @@ end ---@param uri uri ---@return uri function m.getRealUri(uri) + if platform.OS ~= 'Windows' then + return uri + end local filename = furi.decode(uri) -- normalize uri uri = furi.encode(filename) diff --git a/script/filewatch.lua b/script/filewatch.lua index 66e8afb3..2b687dd2 100644 --- a/script/filewatch.lua +++ b/script/filewatch.lua @@ -1,5 +1,6 @@ local fw = require 'bee.filewatch' local fs = require 'bee.filesystem' +local plat = require 'bee.platform' local await = require 'await' local MODIFY = 1 << 0 @@ -11,6 +12,9 @@ local function isExists(filename) if not suc or not exists then return false end + if plat.OS ~= 'Windows' then + return true + end local suc, res = pcall(fs.fullpath, path) if not suc then return false -- cgit v1.2.3