strapi/scripts/remove-dist-tag.sh
Josh 3b0c2be74f chore: trim distTag
Update scripts/remove-dist-tag.sh

Co-Authored-By: Ben Irvin <ben@innerdvations.com>
2023-04-11 08:05:41 +01:00

26 lines
674 B
Bash
Executable File

#!/bin/bash
# Force start from root folder
cd "$(dirname "$0")/.."
set -e
distTag=$DIST_TAG
# trim distTag for whitespace at the start and end
distTag=$(echo "$distTag" | xargs)
if [[ -z "$distTag" ]]; then
echo "Please enter the dist-tag you want to remove"
read -r distTag
fi
# Check if dist tag is latest, beta, alpha or next and reject
if [[ "$distTag" == "latest" || "$distTag" == "beta" || "$distTag" == "alpha" || "$distTag" == "next" ]]; then
echo "You cannot remove the dist-tag $distTag"
exit 1
fi
# Run npm dist-tag rm $distTag on each package
./node_modules/.bin/lerna exec --no-private --stream -- "npm dist-tag rm \$LERNA_PACKAGE_NAME $distTag"