fix: ensure correct file path when importing package

This commit is contained in:
Sagar Vora 2023-07-03 12:53:20 +05:30
parent 8daf25bec6
commit d9167985b1

View file

@ -10,6 +10,7 @@ from frappe.desk.form.load import get_attachments
from frappe.model.document import Document
from frappe.model.sync import get_doc_files
from frappe.modules.import_file import import_doc, import_file_by_path
from frappe.utils import get_files_path
class PackageImport(Document):
@ -35,7 +36,7 @@ class PackageImport(Document):
[
"tar",
"xzf",
frappe.get_site_path(attachment.file_url.strip("/")),
get_files_path(attachment.file_name, is_private=attachment.is_private),
"-C",
frappe.get_site_path("packages"),
]