Codebase list rust-libslirp / run/49047051-381a-4684-afe2-5abd1aee4a89/main dev / filter-semver.sh
run/49047051-381a-4684-afe2-5abd1aee4a89/main

Tree @run/49047051-381a-4684-afe2-5abd1aee4a89/main (Download .tar.gz)

filter-semver.sh @run/49047051-381a-4684-afe2-5abd1aee4a89/main

87c0930
e8aca34
 
721491c
 
 
1
2
3
4
5
6
#!/bin/bash
# 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'