#!/bin/sh
set -eu

if [ "${1:-}" = "-u" ]
then
    exec podman image pull registry.shore.co.il/youtube-dl
fi

exec podman run \
    -it \
    --rm \
    --userns keep-id \
    -w "$PWD" \
    -v "$PWD:$PWD" \
    -v "$HOME/.cache:/tmp/.cache" \
    registry.shore.co.il/youtube-dl \
    "$@"
