1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2024-12-01 16:55:57 +02:00
nerd-fonts/bin/scripts/version-bump.sh
Ryan L McIntyre 5c339b84e7 Workflow for building release candidate
* debugging version
2021-11-21 09:05:02 -08:00

31 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Nerd Fonts Version: 2.1.0
# Script Version: 1.0.1
# bump version number for release in scripts (bash and python)
# does not do semver format checking
# this obviously is not perfect but works good enough for now (YAGNI)
# todo take some ideas from: https://github.com/fsaintjacques/semver-tool
#set -x
LINE_PREFIX="# [Nerd Fonts] "
if [ ! $# -eq 1 ]
then
echo "$LINE_PREFIX No release version given, must give semver release version in format: #.#.#, e.g. 1.1.0"
fi
release=$1
echo "$LINE_PREFIX Bump version to $release"
sed -i "s|[0-9]\\.[0-9]\\.[0-9]|$release|g" ../../font-patcher
sed -i "s|\\# Nerd Fonts Version: [0-9]\\.[0-9]\\.[0-9]|\\# Nerd Fonts Version: $release|g" ../../bin/scripts/**/*.sh
sed -i "s|\\# Nerd Fonts Version: [0-9]\\.[0-9]\\.[0-9]|\\# Nerd Fonts Version: $release|g" ../../bin/scripts/**/*.py
sed -i "s|\\# Nerd Fonts Version: [0-9]\\.[0-9]\\.[0-9]|\\# Nerd Fonts Version: $release|g" ../../bin/scripts/*.sh
sed -i "s|\\# Nerd Fonts Version: [0-9]\\.[0-9]\\.[0-9]|\\# Nerd Fonts Version: $release|g" ../../bin/scripts/*.py
sed -i "s|\\# version: [0-9]\\.[0-9]\\.[0-9]|\\# version: $release|g" ../../bin/scripts/*.sh
sed -i "s|version=\"[0-9]\\.[0-9]\\.[0-9]\"|version=\"$release\"|g" ../../bin/scripts/*.sh
exit