#! /bin/bash

set -euo pipefail

f=$(mktemp )
tar_file=$1.tar.gz

if [ ! -f "$tar_file" ]; then
  echo "No tar file found with specified prefix! Exiting."
  echo "  Prefixes must be absolute or relative to the current directory."
  echo "  (No tilde expansion '~')"
  exit -1
fi

tar xzf $tar_file params.yaml --to-stdout > $f

echo -n "$f"
