summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/core/base/os.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua
index cf662aab3..e857235d2 100644
--- a/xmake/core/base/os.lua
+++ b/xmake/core/base/os.lua
@@ -29,6 +29,9 @@ local path = require("base/path")
local utils = require("base/utils")
local string = require("base/string")
+-- save original tmpdir
+os._tmpdir = os._tmpdir or os.tmpdir
+
-- match files or directories
--
-- @param pattern the search pattern
@@ -245,6 +248,11 @@ function os.cd(dir)
return true
end
+-- get the temporary directory
+function os.tmpdir()
+ return path.join(os._tmpdir(), ".xmake")
+end
+
-- generate the temporary file path
function os.tmpfile()