diff options
| author | ruki <[email protected]> | 2018-02-06 22:33:22 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-02-06 09:20:13 +0800 |
| commit | 698f2dc400aea41f40a9eccc52b7fdc9db856884 (patch) | |
| tree | 1a21d079b05b96e1afd55ec03395f1cf80aae8ad /xmake/core/base | |
| parent | 623575fa425b876a17bb7b45a2ff6bb35ee84aba (diff) | |
add pdpaste and pdcopy on linux
Diffstat (limited to 'xmake/core/base')
| -rw-r--r-- | xmake/core/base/os.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index 7b3bceca3..3841a9d89 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -824,6 +824,11 @@ function os.pbpaste() if ok then return result end + elseif os.host() == "linux" then + local ok, result = os.iorun("xsel --clipboard --output") + if ok then + return result + end else -- TODO end @@ -833,6 +838,8 @@ end function os.pbcopy(data) if os.host() == "macosx" then os.run("bash -c \"echo '" .. data .. "' | pbcopy\"") + elseif os.host() == "linux" then + os.run("bash -c \"echo '" .. data .. "' | xsel --clipboard --input\"") else -- TODO end |
