fix: fix packer archiver splittor issue
This commit is contained in:
@@ -48,7 +48,7 @@ class Archiver:
|
|||||||
target_filepath.parent.mkdir(parents=True, exist_ok=True)
|
target_filepath.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
if self.__dist_zip is not None:
|
if self.__dist_zip is not None:
|
||||||
self.__dist_zip.mkdir(str(arcname))
|
self.__dist_zip.mkdir(arcname.as_posix())
|
||||||
|
|
||||||
def push_file(self, filepath: Path, arcname: Path) -> None:
|
def push_file(self, filepath: Path, arcname: Path) -> None:
|
||||||
"""Mirror an existing file into both sinks.
|
"""Mirror an existing file into both sinks.
|
||||||
@@ -63,7 +63,7 @@ class Archiver:
|
|||||||
shutil.copy(filepath, target_filepath)
|
shutil.copy(filepath, target_filepath)
|
||||||
|
|
||||||
if self.__dist_zip is not None:
|
if self.__dist_zip is not None:
|
||||||
self.__dist_zip.write(filepath, arcname)
|
self.__dist_zip.write(filepath, arcname.as_posix())
|
||||||
|
|
||||||
def push_text(self, text: str, arcname: Path) -> None:
|
def push_text(self, text: str, arcname: Path) -> None:
|
||||||
"""Mirror in-memory text into both sinks.
|
"""Mirror in-memory text into both sinks.
|
||||||
@@ -79,7 +79,7 @@ class Archiver:
|
|||||||
f.write(text)
|
f.write(text)
|
||||||
|
|
||||||
if self.__dist_zip is not None:
|
if self.__dist_zip is not None:
|
||||||
self.__dist_zip.writestr(str(arcname), text)
|
self.__dist_zip.writestr(arcname.as_posix(), text)
|
||||||
|
|
||||||
def __enter__(self) -> "Archiver":
|
def __enter__(self) -> "Archiver":
|
||||||
"""Enter the context and return this archiver as the bound target."""
|
"""Enter the context and return this archiver as the bound target."""
|
||||||
|
|||||||
Reference in New Issue
Block a user