Skip to content

Instantly share code, notes, and snippets.

View biroplane's full-sized avatar
🎯
Focusing

Gaetano Vallarelli biroplane

🎯
Focusing
View GitHub Profile
@biroplane
biroplane / update-package-from-tags
Created April 19, 2023 15:01
Update your package.json file version attribute from latest git tag
#!/bin/bash
# Get the latest git tag
latest_git_tag=$(git describe --tags $(git rev-list --tags --max-count=1))
# Update the package.json version
jq ".version = \"$latest_git_tag\"" package.json > package.json.tmp && mv package.json.tmp package.json
# Display the updated version
echo "Updated package.json version to $latest_git_tag"
cloudService