Skip to content

Commit 522b2d7

Browse files
committed
chore: improve version script to change package.json version for template
1 parent 44ebc93 commit 522b2d7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

scripts/update-template-dependencies.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,25 @@ update_package_json() {
4141
mv "$temp_file" "$file"
4242
}
4343

44+
update_package_json_version() {
45+
local file=$1
46+
echo "Updating version in $file..."
47+
48+
# Get the version from packages/cli/package.json
49+
CLI_VERSION=$(jq -r '.version' packages/cli/package.json)
50+
echo "Using CLI version: $CLI_VERSION"
51+
52+
# Update the version in the package.json file
53+
jq --arg version "$CLI_VERSION" '.version = $version' "$file" > "$temp_file"
54+
55+
# Replace the original file with the updated one
56+
mv "$temp_file" "$file"
57+
}
58+
4459
# Find all package.json files in templates directory and update them
4560
find ./templates -name "package.json" -not -path "*/node_modules/*" | while read -r file; do
4661
update_package_json "$file"
62+
update_package_json_version "$file"
4763
done
4864

4965
# Find all package.json files in packages/*/template directories and update them

0 commit comments

Comments
 (0)