diff options
| author | ruki <[email protected]> | 2023-02-24 00:32:30 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-02-24 00:32:30 +0800 |
| commit | e944c049ca7a8b380ac0754a053026d476020901 (patch) | |
| tree | f7eeac7e0d6e948cee2980366ab71eeb9e2ab4f4 | |
| parent | 0c06f2833d498f3ebcc12b2f9e398af7e497ea09 (diff) | |
improve ramdir #3408
| -rw-r--r-- | xmake/core/base/os.lua | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index c05c718c9..3d0ad886d 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -155,24 +155,14 @@ function os._rm(filedir) end -- get the ramdisk root directory +-- https://github.com/xmake-io/xmake/issues/3408 function os._ramdir() - - -- get root ramdir local ramdir_root = os._ROOT_RAMDIR if ramdir_root == nil then ramdir_root = os.getenv("XMAKE_RAMDIR") end if ramdir_root == nil then - if os.host() == "linux" and os.isdir("/dev/shm") then - ramdir_root = "/dev/shm" - elseif os.host() == "macosx" and os.isdir("/Volumes/RAM") then - -- @note we need the user to execute the command to create it. - -- diskutil partitionDisk `hdiutil attach -nomount ram://8388608` GPT APFS "RAM" 0 - ramdir_root = "/Volumes/RAM" - end - if ramdir_root == nil then - ramdir_root = false - end + ramdir_root = false os._ROOT_RAMDIR = ramdir_root end return ramdir_root or nil |
