Skip to content

Commit

Permalink
Bump to 0.9.3 (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
denisidoro authored Sep 25, 2019
1 parent d974340 commit a802671
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion navi
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ source "${SCRIPT_DIR}/src/main.sh"
##? full docs
##? Please refer to the README at https://github.com/denisidoro/navi

VERSION="0.9.2"
VERSION="0.9.3"

opts::eval "$@"
main "$@"
2 changes: 1 addition & 1 deletion scripts/release
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ header "git push"
git push --follow-tags

header "rm formula"
rm "$formula" || true
rm "$formula" 2>/dev/null || true

header "tar sha256"
sha="$(curl -sL "$tar" | sha256 | awk '{print $1}')"
Expand Down
12 changes: 11 additions & 1 deletion src/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@ handler::help() {
}

handler::version() {
local -r full="${1:-false}"

echo "${VERSION:-unknown}"

if $full; then
source "${SCRIPT_DIR}/src/version.sh"
version::code 2>/dev/null || echo "unknown code"
fi
}

main() {
Expand All @@ -83,7 +90,10 @@ main() {
handler::main
;;
version)
handler::version
handler::version false
;;
full-version)
handler::version true
;;
help)
handler::help
Expand Down
3 changes: 2 additions & 1 deletion src/opts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ opts::eval() {
case $arg in
--print) print=true ;;
--no-interpolation) interpolation=false ;;
--version|version) entry_point="version" ;;
--version) entry_point="version" ;;
--full-version) entry_point="full-version" ;;
help|--help) entry_point="help"; TEXT="$(opts::extract_help "$0")" ;;
--command-for) wait_for="command-for" ;;
--no-preview) preview=false ;;
Expand Down
9 changes: 9 additions & 0 deletions src/version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version::code() {
cd "$SCRIPT_DIR"
local -r git_info=$(git log -n 1 --pretty=format:'%h%n%ad%n%s' --date=format:'%Y-%m-%d %Hh%M')
if [ -z "$git_info" ]; then
return 1
else
echo -e "$git_info"
fi
}

0 comments on commit a802671

Please sign in to comment.