add folder structure to tar
@@ -8,7 +8,6 @@ import tarfile
import time
from pathlib import Path
import click
-from gammapy import __version__
from gammapy.utils.scripts import get_images_paths, get_notebooks_paths
log = logging.getLogger(__name__)
@@ -233,7 +232,8 @@ def cli_jupyter_tar(out):
tar_name = Path(out)
with tarfile.open(tar_name, "w:") as tar:
for name in get_notebooks_paths():
- tar.add(name, arcname=Path(name).name)
+ path_tail = str(name).split(str(PATH_DOCS.resolve()))[1]
+ tar.add(name, arcname=Path(path_tail))
for img in get_images_paths():
- tar.add(name, arcname=Path("images") / Path(img).name)
+ tar.add(name, arcname=Path("tutorials/images") / Path(img).name)
log.info(f"{tar_name} file has been created.")
