From da2d30f101da3f8b73f88ccaba6e333ab7dc40a5 Mon Sep 17 00:00:00 2001 From: Marcel Arns Date: Wed, 8 Nov 2023 14:39:54 +0100 Subject: [PATCH] refactor(action): rename function for cache-control --- s3_artifact/action.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/s3_artifact/action.py b/s3_artifact/action.py index 53a239f..d04ed43 100644 --- a/s3_artifact/action.py +++ b/s3_artifact/action.py @@ -58,7 +58,7 @@ def deploy(config: S3ArtifactConfig, artifacts_s3_path: str, environment: str) - def upload(config: S3ArtifactConfig, target: str) -> Sequence[str]: - def _prepare_metadata_command(cache_config: S3ArtifactCustomMetadataConfig): + def _prepare_cache_control_and_content_type_command(cache_config: S3ArtifactCustomMetadataConfig): content_type = cache_config.mime_type or DEFAULT_MIME_TYPES[Path(cache_config.path).suffix] content_type_option = f"--content-type '{content_type}'" @@ -72,7 +72,10 @@ def _get_default_cache_control(): return ( f"aws s3 sync {config.local_artifacts_path} {target} {_get_default_cache_control()} {S3_SYNC_OPTIONS}", - *(_prepare_metadata_command(custom_metadata) for custom_metadata in config.custom_metadata), + *( + _prepare_cache_control_and_content_type_command(custom_metadata) + for custom_metadata in config.custom_metadata + ), )