diff options
| author | ruki <[email protected]> | 2022-03-09 23:25:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-03-09 23:25:38 +0800 |
| commit | fa2e4a9a5f21a8819beafb99a85652d83b7e5429 (patch) | |
| tree | 8ae328914c4dd54012e0cf6cc013547acaa4caeb /xmake/core/base/path.lua | |
| parent | 4eb65435961776fbefcc11ed774b778532c2c8dd (diff) | |
improve path.directory
Diffstat (limited to 'xmake/core/base/path.lua')
| -rw-r--r-- | xmake/core/base/path.lua | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/xmake/core/base/path.lua b/xmake/core/base/path.lua index 92b926705..712d8e604 100644 --- a/xmake/core/base/path.lua +++ b/xmake/core/base/path.lua @@ -24,23 +24,6 @@ local path = path or {} -- load modules local string = require("base/string") --- get the directory of the path -function path.directory(p, sep) - local i = 0 - if sep then - -- if the path has been normalized, we can quickly find it with a unique path separator prompt - i = p:lastof(sep, true) or 0 - else - i = math.max(p:lastof('/', true) or 0, p:lastof('\\', true) or 0) - end - if i > 0 then - if i > 1 then i = i - 1 end - return p:sub(1, i) - else - return "." - end -end - -- get the filename of the path function path.filename(p, sep) local i = 0 |
