Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
Revert "chore: use locally installed lerna instead of a global one" (#…
Browse files Browse the repository at this point in the history
…1330)

This reverts commit f072a14.
  • Loading branch information
machi1990 authored May 28, 2020
1 parent 96d8216 commit 3ca8238
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/validateRelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
# explicit declaration that this script needs a $TAG variable passed in e.g TAG=1.2.3 ./script.sh
TAG=$TAG
TAG_SYNTAX='^[0-9]+\.[0-9]+\.[0-9]+(-.+)*$'

# get version found in lerna.json. This is the source of truth
PACKAGE_VERSION=$(cat lerna.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]')

# get names of packages being managed by lerna
PACKAGES=$(yarn lerna --loglevel=silent ls | awk -F ' ' '{print $1}')
PACKAGES=$(lerna --loglevel=silent ls | awk -F ' ' '{print $1}')

# validate tag has format x.y.z
if [[ "$(echo $TAG | grep -E $TAG_SYNTAX)" == "" ]]; then
Expand All @@ -23,7 +24,7 @@ fi

# validate that all packages have the same version found in lerna.json
for package in $PACKAGES; do
version=$(yarn lerna --loglevel=silent ls -l | grep $package | awk -F ' ' '{print $2}' | cut -c2-)
version=$(lerna --loglevel=silent ls -l | grep $package | awk -F ' ' '{print $2}' | cut -c2-)
if [[ $version =~ $PACKAGE_VERSION ]]; then
echo "package $package has version $version"
else
Expand Down

0 comments on commit 3ca8238

Please sign in to comment.