diff options
Diffstat (limited to 'src/lib/path.lua')
| -rw-r--r-- | src/lib/path.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/path.lua b/src/lib/path.lua index f99585b..a0be1e5 100644 --- a/src/lib/path.lua +++ b/src/lib/path.lua @@ -112,6 +112,20 @@ function Path:make_directory(opts) pipe:close() end +function Path:copy_to(target) + local pipe = io.popen('cp -r ' .. tostring(self) .. ' ' .. tostring(target)) + pipe:close() +end + +function Path:remove(opts) + local pipe = io.popen('rm ' .. + (opts.recursive and '-r ' or ' ') .. + (opts.force and '-f ' or ' ') .. + tostring(self) + ) + pipe:close() +end + return { tests = { function() |