We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Path:copy()
1 parent 25b0cc8 commit fded248Copy full SHA for fded248
1 file changed
lua/plenary/path.lua
@@ -592,11 +592,14 @@ function Path:copy(opts)
592
local dest = opts.destination
593
-- handles `.`, `..`, `./`, and `../`
594
if not Path.is_path(dest) then
595
- if type(dest) == "string" and dest:match "^%.%.?/?\\?.+" then
596
- dest = {
597
- uv.fs_realpath(dest:sub(1, 3)),
598
- dest:sub(4, #dest),
599
- }
+ if type(dest) == "string" then
+ local m = dest:match "^%.%.?/?\\?.+"
+ if m then
+ dest = {
+ uv.fs_realpath(dest:sub(1, #m)),
600
+ dest:sub(#m + 1),
601
+ }
602
+ end
603
end
604
dest = Path:new(dest)
605
0 commit comments