Last active
September 4, 2020 08:17
-
-
Save akovac35/07ea9cf03036a2a4119b8ece9f8decdd to your computer and use it in GitHub Desktop.
This bash script will increase the last digit of all csproj files within the current solution folder which contain version element.
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
# Authors | |
# Aleksander Kovač https://github.com/akovac35 | |
# | |
# This bash script will increase the last digit of all csproj files within the current | |
# solution folder which contain version element. | |
while read -r line ; do | |
echo "Processing $line" | |
# Need to use intermediate file because of perl locks | |
cp $line{,.bak} | |
(perl -pe 's/^(\s*<Version>)((\d+\.)*)(\d+)(.*)$/$1.$2.($4+1).$5/e' < $line.bak) > $line | |
rm $line.bak | |
done < <(grep -ril --include \*.csproj -E "<Version>.+</Version>" ./) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment