mattermost-desktop/scripts/cp_artifacts.sh

21 lines
424 B
Bash
Raw Normal View History

2024-10-03 06:35:14 -07:00
#!/usr/bin/env bash
set -eu
VERSION="$(jq -r '.version' <package.json)"
SRC="${1}"
DEST="${2}"
if [[ ! -d "${DEST}/${VERSION}" ]]; then
echo "Can't find destination. Creating \"${DEST}/${VERSION}\""
mkdir -p "${DEST}/${VERSION}"
fi
if [[ ! -d "${SRC}/${VERSION}" ]]; then
echo "Can't find source directory, exiting."
exit 1
fi
cp -rv "${SRC}/${VERSION}" "${DEST}/"
cp -v "${SRC}"/*.yml "${DEST}/"
exit 0