Skip to content

Commit

Permalink
debug replace-versions.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
guplersaxanoid committed Oct 27, 2023
1 parent b6b86fe commit 0ef8cdf
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/scripts/replace-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,25 @@ packages["./packages/types"]="@subql/types"
packages["./packages/utils"]="@subql/utils"
packages["./packages/testing"]="@subql/testing"

# Path to the node package.json
node_package_json="./packages/node/package.json"

# Iterate over each package
for package in ${!packages[@]}
do
# Get the version of the current package
version=$(jq -r '.version' $package/package.json)
echo $package
echo $version
# Replace workspace:* with the actual version in package.json of node
sed -i.bak "s#\"${packages[$package]}\": \"workspace:\*\"#\"${packages[$package]}\": \"$version\"#g" ./packages/node/package.json
# Remove the backup file
rm ./packages/node/package.json.bak
echo $version

# Check if the node package.json file exists
if [[ -f $node_package_json ]]; then
# Replace workspace:* with the actual version in package.json of node
sed -i.bak "s#\"${packages[$package]}\": \"workspace:\*\"#\"${packages[$package]}\": \"$version\"#g" $node_package_json
# Remove the backup file
rm "${node_package_json}.bak"
else
echo "Error: $node_package_json does not exist."
exit 1
fi
done

0 comments on commit 0ef8cdf

Please sign in to comment.