Allow transferring files outside of HOME

This commit is contained in:
Kovid Goyal
2022-02-28 11:49:22 +05:30
parent 4b6bfaffba
commit 8867317b6a
4 changed files with 20 additions and 15 deletions

View File

@@ -75,7 +75,8 @@ def get_arcname(loc: str, dest: Optional[str], home: str) -> str:
if arcname.startswith(home):
arcname = os.path.relpath(arcname, home)
arcname = os.path.normpath(arcname).replace(os.sep, '/')
return arcname
prefix = 'root' if arcname.startswith('/') else 'home/'
return prefix + arcname
class CopyInstruction(NamedTuple):