Codebase list rust-serde-xml-rs / 885ad203-f2b7-49bd-bf22-8c9777f4a064/main dev / filter-semver.sh
885ad203-f2b7-49bd-bf22-8c9777f4a064/main

Tree @885ad203-f2b7-49bd-bf22-8c9777f4a064/main (Download .tar.gz)

filter-semver.sh @885ad203-f2b7-49bd-bf22-8c9777f4a064/mainraw · history · blame

1
2
3
4
5
6
#!/bin/sh
# Given a full version string, output just the part that is significant for
# semver. i.e.. 0.x.* becomes 0.x and x.* becomes x for x != 0.
sed -r \
 -e 's/([1-9]+)\.[0-9]+\.[0-9]+/\1/g' \
 -e 's/(0\.[0-9]+)\.[0-9]+/\1/g'