From 579ce7f91da5ee676c018ea741d446f6c9091384 Mon Sep 17 00:00:00 2001 From: David Rubin Date: Mon, 15 Jan 2018 18:52:06 +0100 Subject: [PATCH] Create version bump script Simple script to replace the version of gitlab in all the files. Works on osx and linux --- bump-version.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 bump-version.sh diff --git a/bump-version.sh b/bump-version.sh new file mode 100755 index 000000000..6ab2450db --- /dev/null +++ b/bump-version.sh @@ -0,0 +1,19 @@ +#!/bin/bash -e +# Replaces the current gitlab version with a new version + +display_usage() { + echo "Replaces the current gitlab version" + echo -e "\nUsage:\n./bump-version.sh [new-version] \n./bump-version.sh 0.9.0" +} + +if [[ $# != 1 ]] +then + display_usage + exit 1 +fi + +NEW_VERSION="$1" +CURRENT_VERSION="$(cat VERSION)" +# -i.sedbak so its portable between osx and linux +grep --exclude="Changelog.md" -rl "$CURRENT_VERSION" ./ | xargs sed -i.sedbak "s/$CURRENT_VERSION/$NEW_VERSION/g" +find . -name "*.sedbak" -print0 | xargs -0 rm