create cli commands for project backpack functions

This commit is contained in:
Jakub Trllo 2022-02-02 15:39:53 +01:00
parent c6b109bcdb
commit 7d19db96c4
2 changed files with 30 additions and 0 deletions

View file

@ -412,3 +412,23 @@ def repack_version(directory):
directory name.
"""
PypeCommands().repack_version(directory)
@main.command()
@click.option("--project", help="Project name")
@click.option(
"--dirpath", help="Directory where package is stored", default=None
)
def pack_project(project_name, dirpath):
"""Create a package of project with all files and database dump."""
PypeCommands().pack_project(project_name, dirpath)
@main.command()
@click.option("--zipfile", help="Path to zip file")
@click.option(
"--root", help="Replace root which was stored in project", default=None
)
def uppack_project(zipfile, root):
"""Create a package of project with all files and database dump."""
PypeCommands().unpack_project(zipfile, root)

View file

@ -433,3 +433,13 @@ class PypeCommands:
version_packer = VersionRepacker(directory)
version_packer.process()
def pack_project(project_name, dirpath):
from openpype.lib.project_backpack import pack_project
pack_project(project_name, dirpath)
def unpack_project(zip_filepath, new_root):
from openpype.lib.project_backpack import unpack_project
unpack_project(zip_filepath, new_root)