From 2454f11c8a69705cff2b44eb0154f0b94ee3c51c Mon Sep 17 00:00:00 2001 From: planctus Date: Mon, 14 Aug 2023 14:44:53 +0300 Subject: [PATCH] chore(ci): Small tweaks - FRONT-4054 --- scripts/packagesList.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/packagesList.sh b/scripts/packagesList.sh index 9f6b6349ca9..80ea0def35a 100755 --- a/scripts/packagesList.sh +++ b/scripts/packagesList.sh @@ -1,13 +1,16 @@ #!/bin/bash -# Find all package.json files in the root directory and its subdirectories, -# excluding node_modules and only searching in @ecl/ directories +# Go to project root +cd "$(dirname "$0")" +cd .. -public_packages=$(find $(dirname "$root_dir") -type f -name "package.json" -not -path "*/node_modules/*" -exec grep -L '"private": true' {} + | xargs -I {} grep -o '"name": "[^"]*' {} | cut -d'"' -f4) -lerna_version=$(grep -o '"version": "[^"]*' "$(dirname "$root_dir")/lerna.json" | cut -d'"' -f4); +# Find all package.json files in the root directory and its subdirectories. +public_packages=$(find . -type f -name "package.json" -not -path "*/node_modules/*" -exec grep -L '"private": true' {} + | xargs -I {} grep -o '"name": "[^"]*' {} | cut -d'"' -f4) +# Get the version +lerna_version=$(grep -o '"version": "[^"]*' "lerna.json" | cut -d'"' -f4); # Output the list of public packages and save it to a file in the root -output_file="$(dirname "$root_dir")/ECL-npm-packages" +output_file="ECL-npm-packages" echo "Public packages:" > "$output_file" for package in $public_packages; do echo "$package@$lerna_version" >> "$output_file"