Skip to content

Commit

Permalink
fix: correct startup checking exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
adamtabrams committed May 29, 2020
1 parent 72e4792 commit 0a8023d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.5.1] - 2020-05-29
### Fixed
- For commands that require it, check if it's in a git repo.
- Corrected return code for checking done at startup.
- Recognize token BREAKING-CHANGE in the footer.

### Changed
- Improve usage message added Tips section to README.

## [0.5.0] - 2020-05-29
### Added
- Use GitHub personal access token for auth.
Expand Down Expand Up @@ -48,7 +57,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Created a proof of concept for a changelog updater.

[Unreleased]: https://github.com/adamtabrams/change/compare/0.5.0...HEAD
[Unreleased]: https://github.com/adamtabrams/change/compare/0.5.1...HEAD
[0.5.1]: https://github.com/adamtabrams/change/compare/0.5.0...0.5.1
[0.5.0]: https://github.com/adamtabrams/change/compare/0.4.1...0.5.0
[0.4.1]: https://github.com/adamtabrams/change/compare/0.4.0...0.4.1
[0.4.0]: https://github.com/adamtabrams/change/compare/0.3.0...0.4.0
Expand Down
7 changes: 4 additions & 3 deletions change
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,11 @@ get_commits_between() {
startup_checks() {
! git rev-parse 2> /dev/null && { echo "you're no in a git repo" >&2; exit 1; }
[ ! -e "$change_file" ] && { echo "couldn't find $change_file" >&2; exit 1; }
return 0
}

make_and_push_tag() {
startup_checks || exit 1
! startup_checks && exit 1

latest_log_ver_name=$(sed -n "s|^\[Unreleased\]:.*/\(.*\)\.\.\.HEAD$|\1|p" $change_file)

Expand All @@ -186,7 +187,7 @@ auth() {
}

post_release() {
startup_checks || exit 1
! startup_checks && exit 1
[ ! -e "$auth_file" ] && { echo "you need to save a token with the auth" >&2; exit 1; }

auth_token=$(base64 -D < "$auth_file")
Expand Down Expand Up @@ -248,7 +249,7 @@ $(format_commits "$first_commits")
[ "$1" = "--help" ] && { usage; exit; }
[ "$1" ] && { printf "couldn't recognize argument\n\n" >&2; usage >&2; exit 1; }

startup_checks || exit 1
! startup_checks && exit 1

latest_git_ver_name=$(git tag --list "[[:digit:]]*\.[[:digit:]]*" --sort="-v:refname" | head -1)
latest_log_ver_name=$(sed -n "s|^\[Unreleased\]:.*/\(.*\)\.\.\.HEAD$|\1|p" $change_file)
Expand Down

0 comments on commit 0a8023d

Please sign in to comment.