File tree Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -2691,20 +2691,24 @@ end
26912691-- LFS optimize
26922692---- -------------------------------------------------------------------
26932693os .lfs = {}
2694- os .lfs .disable = os.getenv (' _ZL_DISABLE_LFS' )
2695- if os .lfs .disable == nil then
2696- os .lfs .status , os .lfs .pkg = pcall (require , ' lfs' )
2697- if os .lfs .status then
2698- local lfs = os .lfs .pkg
2699- os .path .exists = function (name )
2700- return lfs .attributes (name ) and true or false
2701- end
2702- os .path .isdir = function (name )
2703- local mode = lfs .attributes (name )
2704- if not mode then
2705- return false
2694+ os .lfs .enable = os.getenv (' _ZL_USE_LFS' )
2695+ os .lfs .enable = ' 1'
2696+ if os .lfs .enable ~= nil then
2697+ local m = string.lower (os .lfs .enable )
2698+ if (m == ' 1' or m == ' yes' or m == ' true' or m == ' t' ) then
2699+ os .lfs .status , os .lfs .pkg = pcall (require , ' lfs' )
2700+ if os .lfs .status then
2701+ local lfs = os .lfs .pkg
2702+ os .path .exists = function (name )
2703+ return lfs .attributes (name ) and true or false
2704+ end
2705+ os .path .isdir = function (name )
2706+ local mode = lfs .attributes (name )
2707+ if not mode then
2708+ return false
2709+ end
2710+ return (mode .mode == ' directory' ) and true or false
27062711 end
2707- return (mode .mode == ' directory' ) and true or false
27082712 end
27092713 end
27102714end
You can’t perform that action at this time.
0 commit comments