mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +01:00
feat(updater): save version prior to updating so omz changelog just works™
Fixes #9505
This commit is contained in:
parent
9d6b3984f9
commit
e8e37eedbc
2 changed files with 16 additions and 3 deletions
|
|
@ -340,16 +340,23 @@ function display-release {
|
|||
|
||||
function main {
|
||||
# $1 = until commit, $2 = since commit
|
||||
# $3 = output format (--raw|--text|--md)
|
||||
local until="$1" since="$2"
|
||||
|
||||
# $3 = output format (--text|--raw|--md)
|
||||
# --md: uses markdown formatting
|
||||
# --raw: outputs without style
|
||||
# --text: uses ANSI escape codes to style the output
|
||||
local output=${${3:-"--text"}#--*}
|
||||
|
||||
if [[ -z "$until" ]]; then
|
||||
until=HEAD
|
||||
fi
|
||||
|
||||
# If $since is not specified, look up first version tag before $until
|
||||
if [[ -z "$since" ]]; then
|
||||
# If $since is not specified:
|
||||
# 1) try to find the version used before updating
|
||||
# 2) try to find the first version tag before $until
|
||||
since=$(command git config --get oh-my-zsh.lastVersion 2>/dev/null) || \
|
||||
since=$(command git describe --abbrev=0 --tags "$until^" 2>/dev/null) || \
|
||||
unset since
|
||||
elif [[ "$since" = --all ]]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue