Permalink
Browse files

updated bump-script to allow for auto-commit.

  • Loading branch information...
1 parent 510d884 commit 41f9bdb864000ce5d6fa6ea2c230399ab7c1a843 @d1rk d1rk committed Nov 28, 2011
Showing with 15 additions and 7 deletions.
  1. +15 −7 scripts/bump
View
@@ -8,9 +8,15 @@ set -o errexit
#folder=`pwd` #if $0 is at root
folder=`cd "$(dirname $0)"; pwd | sed s/\\\/scripts//g` #if $0 is in /scripts
-version_file="$folder/VERSION.txt"
+# please adjust to your needs
+autocommit=true
+version_filename="VERSION.txt"
+changelog_filename="CHANGELOG.txt"
+
+# do not touch
+version_file="$folder/$version_filename"
version_temp="$folder/.VERSION.txt.new"
-changelog_file="$folder/CHANGELOG.txt"
+changelog_file="$folder/$changelog_filename"
changelog_temp="$folder/.CHANGELOG.txt.new"
# prints usage (when called with help, -h or --help)
@@ -57,11 +63,12 @@ update_changelog() {
# commit to git
commit() {
if [ -d "$folder/.git" ]; then
- git reset HEAD .
+ git reset -q HEAD .
git add $version_file $changelog_file
- git commit -m "Bumped Version to $version\n\n$description"
- git tag -a "$version" -m "Bumped Version to $version\n\n$description"
- git push --tags master
+ git commit -m "Bumped Version to $version"
+ git push
+ git tag -a "$version" -m "Bumped Version to $version"
+ git push --tags
fi
}
@@ -115,6 +122,7 @@ fi
update_version
update_changelog
+if $autocommit; then commit fi
+
#update_changelog_md #unfinished
-commit

0 comments on commit 41f9bdb

Please sign in to comment.