-
-
Save vitalk/c0e802f485d13e3d8ec9 to your computer and use it in GitHub Desktop.
Bump new version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
#: usage: bump <version> <upcoming> | |
#: | |
#: For each file in current directory and subdirectories | |
#: update any <version> string to the new <upcoming> value. | |
function help() { | |
sed -En 's/^#:[[:space:]]?//p' $0 | |
} | |
if [[ $# -ne 2 ]]; then | |
help && exit; | |
fi | |
version=$1 | |
next_version=$2 | |
egrep -r --exclude-dir "node_modules" -l "[\"']$version[\"']" * | \ | |
xargs sed -i "" "s/$version/$next_version/g" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment