File get_assets.sh of Package iocaine

#! /usr/bin/env bash

set -euo pipefail

PKG_DIR="$PWD"
PKG_TMPDIR="$(mktemp -d)"
PKG_NAME="iocaine"
PKG_VERSION="$1"

if ! which just
then
  echo "'just' is required to download assets"
  exit 1
fi

tar -C "${PKG_TMPDIR}" --zstd -xf "${PKG_NAME}-${PKG_VERSION}.tar.gz"
(
  cd "${PKG_TMPDIR}/${PKG_NAME}"
  just update assets
  tar --zstd -cf "${PKG_DIR}/assets-${PKG_VERSION}.tar.zst" iocaine-label/assets
)
openSUSE Build Service is sponsored by