Skip to content

Commit

Permalink
Fix build-and-publish
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-z committed Dec 28, 2024
1 parent 5dcaeb5 commit 680041b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ jobs:
- name: Run sanity check
run: |
gatrace --help
gatrace version
docker-unpack --help
docker-unpack version
publish:
runs-on: ubuntu-latest
Expand Down
18 changes: 14 additions & 4 deletions src/docker_unpack/cli.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
import json
import sys
import os
import tarfile
import tempfile
import time
from pathlib import Path
import os

from watcloud_utils.logging import logger, set_up_logging

set_up_logging()

from watcloud_utils.typer import app, typer

from ._version import __version__


@app.command()
def version():
"""
Print the version of the tool.
"""
print(__version__)


def escape(value):
"""Escapes special characters in a string for use in a shell script."""
Expand Down Expand Up @@ -137,7 +145,9 @@ def generate_env(root_path: Path, img_config: dict):
@app.command()
def unpack(input_file: typer.FileBinaryRead, output_dir: Path):
if output_dir.exists() and any(output_dir.iterdir()):
raise Exception(f"Output directory {output_dir} already exists and is not empty!")
raise Exception(
f"Output directory {output_dir} already exists and is not empty!"
)

with tempfile.TemporaryDirectory() as temp_dir:
logger.info(f"Extracting tar file to {temp_dir=}")
Expand Down

0 comments on commit 680041b

Please sign in to comment.