return e2lib.call_tool_argv("mv", { src, dst })
end
---- call the cp command
+--- Call the cp command.
-- @param src string: source name
-- @param dst string: destination name
--- @param flags string: additional flags
+-- @param recursive True enables recursive copying. The default is false.
-- @return bool
-- @return the last line ouf captured output
-function e2lib.cp(src, dst, flags)
- if not flags then
- flags = ""
+function e2lib.cp(src, dst, recursive)
+ local argv
+
+ argv = { src, dst }
+ if recursive then
+ table.insert(argv, 1, "-R")
end
- local args = string.format("%s '%s' '%s'", flags, src, dst)
- return e2lib.call_tool("cp", args)
+
+ return e2lib.call_tool_argv("cp", argv)
end
--- call the curl command
-- cp -R info.root/src.working/src.workingcopy_subdir build_path
local s = e2lib.join(info.root, src.working, src.workingcopy_subdir)
local d = e2lib.join(build_path, src.name)
- rc, re = e2lib.cp(s, d, "-R")
+ rc, re = e2lib.cp(s, d, true)
if not rc then
return false, e:cat(re)
end