diff options
Diffstat (limited to 'xmake/core/base/os.lua')
| -rw-r--r-- | xmake/core/base/os.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index d8d439155..7b3bceca3 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -817,6 +817,27 @@ function os.addenv(name, ...) return os.setenv(name, table.concat({...}, seperator) .. seperator .. (os.getenv(name) or "")) end +-- read string data from pasteboard +function os.pbpaste() + if os.host() == "macosx" then + local ok, result = os.iorun("pbpaste") + if ok then + return result + end + else + -- TODO + end +end + +-- copy string data to pasteboard +function os.pbcopy(data) + if os.host() == "macosx" then + os.run("bash -c \"echo '" .. data .. "' | pbcopy\"") + else + -- TODO + end +end + -- get the program directory function os.programdir() return xmake._PROGRAM_DIR |
