mirror of
https://github.com/ovh/php-ovh.git
synced 2023-11-05 03:20:26 +01:00
add bump-version helper. See #37
Signed-off-by: Jean-Tiare Le Bigot <jt@yadutaf.fr>
This commit is contained in:
parent
815b07ba22
commit
3ebf59eefb
19
scripts/bump-version.sh
Normal file
19
scripts/bump-version.sh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Usage: ./scripts/bump-version.sh <new.version.number>
|
||||||
|
#
|
||||||
|
|
||||||
|
PCRE_MATCH_VERSION="[0-9]+\.[0-9]+\.[0-9]+"
|
||||||
|
PCRE_MATCH_VERSION_BOUNDS="(^|[- v/'\"])${PCRE_MATCH_VERSION}([- /'\"]|$)"
|
||||||
|
VERSION="$1"
|
||||||
|
|
||||||
|
if ! echo "$VERSION" | grep -Pq "${PCRE_MATCH_VERSION}"; then
|
||||||
|
echo "Usage: ./scripts/bump-version.sh <new.version.number>"
|
||||||
|
echo " <new.version.number> must be a valid 3 digit version number"
|
||||||
|
echo " Make sure to double check 'git diff' before commiting anything you'll regret on master"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Edit text files matching the PCRE, do *not* patch .git folder
|
||||||
|
grep -PIrl "${PCRE_MATCH_VERSION_BOUNDS}" $(ls) | xargs sed -ir "s/${PCRE_MATCH_VERSION_BOUNDS}/"'\1'"${VERSION}"'\2/g'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user