File get-sources.sh of Package sunshine

#!/usr/bin/sh

set -e

if [[ -z "$1" ]]; then
echo "Please enter the version you want to update to";
exit 1;
fi

VERSION="$1"

echo "++++++++++++++++++++++++++++++++++++++++++++++"
echo "patching service file and downloading sources"
echo "++++++++++++++++++++++++++++++++++++++++++++++"

sed -i -e 's|<param name="revision">refs/tags/v.*|<param name="revision">refs/tags/v'${VERSION}'</param>|g' _service
osc service mr obs_scm
osc service mr set_version

echo "++++++++++++++++++++++++++++++++++++++++++++++"
echo "fetching package.json and generating lock file"
echo "++++++++++++++++++++++++++++++++++++++++++++++"

cp sunshine/package.json .
npm install --package-lock-only

echo "++++++++++++++++++++++++++++++++++++++++++++++"
echo "Downloading node_modules"
echo "++++++++++++++++++++++++++++++++++++++++++++++"

osc service mr node_modules

echo "++++++++++++++++++++++++++++++++++++++++++++++"
echo "Cleanup Step"
echo "++++++++++++++++++++++++++++++++++++++++++++++"

rm package.json
rm node_modules.sums

echo "++++++++++++++++++++++++++++++++++++++++++++++"
echo "Done! Have fun building and testing"
echo "++++++++++++++++++++++++++++++++++++++++++++++"
openSUSE Build Service is sponsored by