summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-08-17 23:22:46 +0800
committerruki <[email protected]>2022-08-17 23:22:46 +0800
commit41c70cef65f4f82e718924ae934dd6323d5b60ad (patch)
tree9b09fb86073cb642f085445b49276c90c4b55c89
parent437c4ab00991749fb8db108cb2b14f4dff81333c (diff)
improve os.touch
-rw-r--r--xmake/core/base/os.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua
index fff5c8408..fdbc3edbf 100644
--- a/xmake/core/base/os.lua
+++ b/xmake/core/base/os.lua
@@ -559,7 +559,7 @@ end
-- we will do not change it if atime/mtime is zero
function os.touch(filepath, opt)
opt = opt or {}
- if not os._touch(filepath, opt.atime or 0, opt.mtime or 0) then
+ if os._touch and not os._touch(filepath, opt.atime or 0, opt.mtime or 0) then
return false, string.format("cannot touch %s, %s", filepath, os.strerror())
end
return true