File rubocop-1.60.2-container of Package rubygem-rubocop-container

#! /bin/sh

set -e

IMAGE="registry.opensuse.org/yast/head/containers_tumbleweed/rubocop:latest"

# use podman, if not available try docker
if command -v podman &> /dev/null; then
    TOOL="podman"
elif command -v docker &> /dev/null; then
    TOOL="docker"
else
    echo "ERROR: Container runtime not installed, install 'podman' or 'docker' package" >&2
    exit 1
fi

# optionally update the container image
if [ "$UPDATE_IMAGE" == "1" ]; then
    $TOOL pull $IMAGE
fi

$TOOL run -it --rm -v "$PWD":/work/src -u "$(id -u):$(id -g)" $IMAGE rubocop "$@"
openSUSE Build Service is sponsored by