summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rw-r--r--script/encoder/ansi.lua2
-rw-r--r--script/file-uri.lua4
-rw-r--r--script/files.lua6
-rw-r--r--script/fs-utility.lua1
-rw-r--r--script/proto/proto.lua2
-rw-r--r--script/workspace/require-path.lua2
-rw-r--r--script/workspace/workspace.lua4
7 files changed, 10 insertions, 11 deletions
diff --git a/script/encoder/ansi.lua b/script/encoder/ansi.lua
index 7cb64ec3..f89ddbc1 100644
--- a/script/encoder/ansi.lua
+++ b/script/encoder/ansi.lua
@@ -1,7 +1,7 @@
local platform = require 'bee.platform'
local windows
-if platform.OS == 'Windows' then
+if platform.os == 'windows' then
windows = require 'bee.windows'
end
diff --git a/script/file-uri.lua b/script/file-uri.lua
index 8a075f7e..192f3ab5 100644
--- a/script/file-uri.lua
+++ b/script/file-uri.lua
@@ -25,7 +25,7 @@ local m = {}
---@return uri uri
function m.encode(path)
local authority = ''
- if platform.OS == 'Windows' then
+ if platform.os == 'windows' then
path = path:gsub('\\', '/')
end
@@ -82,7 +82,7 @@ function m.decode(uri)
else
value = path
end
- if platform.OS == 'Windows' then
+ if platform.os == 'windows' then
value = value:gsub('/', '\\')
end
return value
diff --git a/script/files.lua b/script/files.lua
index 8cc7a5ab..b9df5695 100644
--- a/script/files.lua
+++ b/script/files.lua
@@ -78,7 +78,7 @@ end
---@param uri uri
---@return uri
function m.getRealUri(uri)
- if platform.OS ~= 'Windows' then
+ if platform.os ~= 'windows' then
return furi.normalize(uri)
end
if not furi.isValid(uri) then
@@ -833,7 +833,7 @@ function m.isDll(uri)
if not ext then
return false
end
- if platform.OS == 'Windows' then
+ if platform.os == 'windows' then
if ext == 'dll' then
return true
end
@@ -932,7 +932,7 @@ function m.normalize(path)
break
end
end
- if platform.OS == 'Windows' then
+ if platform.os == 'windows' then
path = path:gsub('[/\\]+', '\\')
:gsub('[/\\]+$', '')
:gsub('^(%a:)$', '%1\\')
diff --git a/script/fs-utility.lua b/script/fs-utility.lua
index 8d2bf319..35b336fe 100644
--- a/script/fs-utility.lua
+++ b/script/fs-utility.lua
@@ -570,7 +570,6 @@ end
--- 文件列表
function m.fileList(option)
option = option or buildOption(option)
- local os = platform.OS
local keyMap = {}
local fileList = {}
local function computeKey(path)
diff --git a/script/proto/proto.lua b/script/proto/proto.lua
index 2460b4ec..b0d5d1a9 100644
--- a/script/proto/proto.lua
+++ b/script/proto/proto.lua
@@ -232,7 +232,7 @@ end
function m.listen(mode, socketPort)
m.mode = mode
if mode == 'stdio' then
- if platform.OS == 'Windows' then
+ if platform.os == 'windows' then
local windows = require 'bee.windows'
windows.filemode(io.stdin, 'b')
windows.filemode(io.stdout, 'b')
diff --git a/script/workspace/require-path.lua b/script/workspace/require-path.lua
index c319cbad..1507183c 100644
--- a/script/workspace/require-path.lua
+++ b/script/workspace/require-path.lua
@@ -123,7 +123,7 @@ function mt:getRequireResultByPath(path)
cutedPath = currentPath:sub(pos)
head = currentPath:sub(1, pos - 1)
pos = currentPath:match('[/\\]+()', pos)
- if platform.OS == 'Windows' then
+ if platform.os == 'windows' then
searcher = searcher :gsub('[/\\]+', '\\')
else
searcher = searcher :gsub('[/\\]+', '/')
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua
index 97518e84..fe7c6c15 100644
--- a/script/workspace/workspace.lua
+++ b/script/workspace/workspace.lua
@@ -188,7 +188,7 @@ function m.getNativeMatcher(scp)
local matcher = glob.gitignore(pattern, {
root = scp.uri and furi.decode(scp.uri),
- ignoreCase = platform.OS == 'Windows',
+ ignoreCase = platform.os == 'windows',
}, globInteferFace)
scp:set('nativeMatcher', matcher)
@@ -236,7 +236,7 @@ function m.getLibraryMatchers(scp)
local nPath = fs.absolute(fs.path(path)):string()
local matcher = glob.gitignore(pattern, {
root = path,
- ignoreCase = platform.OS == 'Windows',
+ ignoreCase = platform.os == 'windows',
}, globInteferFace)
matchers[#matchers+1] = {
uri = furi.encode(nPath),