Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,18 @@ If that isn't found, it assumes the current version is `0.0.0`.
Alternatively you may use `patch`, `minor` and `major` as version.
A bump of that level will take place.

If the commands are run with version, that version will be used (no bumping).
If the commands are run with version, that version will be used (no bumping):

```sh
git flow release start 1.1.0
git flow hostfix start 1.1.2
```

You can avoid writing to the version-file by specifying in your `git-flow-hooks-config.sh`:

```sh
VERSION_WRITE=false
```

Bump messages
-------------
Expand Down
5 changes: 5 additions & 0 deletions modules/bump-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ if [ -z "$VERSION" ]; then
fi

VERSION_FILE=$(__get_version_file)

if [[ $(__write_version) == false ]]; then
rm -f $VERSION_FILE
fi

VERSION=$($HOOKS_DIR/modules/semverbump.sh "$VERSION" "$VERSION_FILE" "$VERSION_SORT")

if [ $? -ne 0 ]; then
Expand Down
8 changes: 8 additions & 0 deletions modules/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,11 @@ function __is_binary {

return 1
}

function __write_version {
if [ "${VERSION_WRITE}" == true ]; then
echo true
else
echo false
fi
}
1 change: 1 addition & 0 deletions modules/git-flow-hooks-config.sh.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ VERSION_BUMPLEVEL_HOTFIX="PATCH"
VERSION_BUMPLEVEL_RELEASE="MINOR"
VERSION_BUMP_MESSAGE="Bump version to %version%"
VERSION_TAG_PLACEHOLDER="%tag%"
VERSION_WRITE=true
4 changes: 4 additions & 0 deletions modules/write-version.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/usr/bin/env bash

if [[ $(__write_version) == false ]]; then
return 0
fi

VERSION_FILE=$(__get_version_file)
VERSION_PREFIX=$(git config --get gitflow.prefix.versiontag)

Expand Down