diff options
Diffstat (limited to 'xmake/core/base/path.lua')
| -rw-r--r-- | xmake/core/base/path.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/xmake/core/base/path.lua b/xmake/core/base/path.lua index 494961c09..aa0cd571a 100644 --- a/xmake/core/base/path.lua +++ b/xmake/core/base/path.lua @@ -197,5 +197,15 @@ function path.pattern(pattern) return pattern end +-- get cygwin-style path on msys2/cygwin, e.g. "c:\xxx" -> "/c/xxx" +function path.cygwin_path(p) + p = p:gsub("\\", "/") + local pos = p:find(":/") + if pos == 2 then + return "/" .. p:sub(1, 1) .. p:sub(3) + end + return p +end + -- return module: path return path |
