From 5a8d5756025f1cb652888b5057f7045a1b6d1bdb Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 5 Jul 2023 14:11:32 +0200 Subject: [PATCH] Extract getcurrent version --- scripts/getCurrentVersion.sh | 7 +++++++ scripts/updateVersions.sh | 6 +----- 2 files changed, 8 insertions(+), 5 deletions(-) create mode 100755 scripts/getCurrentVersion.sh diff --git a/scripts/getCurrentVersion.sh b/scripts/getCurrentVersion.sh new file mode 100755 index 0000000000..61522b1666 --- /dev/null +++ b/scripts/getCurrentVersion.sh @@ -0,0 +1,7 @@ +#!/bin/bash +version=$(cat lerna.json \ + | grep version \ + | head -1 \ + | awk -F: '{gsub(/"/,"",$2);gsub(/[[:space:]]*/,"",$2); print $2}' \ + | sed 's/[",]//g') +echo $version diff --git a/scripts/updateVersions.sh b/scripts/updateVersions.sh index 51ad70366c..1d019fd886 100755 --- a/scripts/updateVersions.sh +++ b/scripts/updateVersions.sh @@ -1,9 +1,5 @@ #!/bin/bash -version=$(cat lerna.json \ - | grep version \ - | head -1 \ - | awk -F: '{gsub(/"/,"",$2);gsub(/[[:space:]]*/,"",$2); print $2}' \ - | sed 's/[",]//g') +version=$(./scripts/getCurrentVersion.sh) echo "Setting version $version" yarn lerna exec "yarn version --no-git-tag-version --new-version=$version" echo "Updating dependencies"