Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
4b3a5c54
Unverified
Commit
4b3a5c54
authored
Oct 26, 2021
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(changelog): fix percent escapes in `printf` calls
parent
0267cb89
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
changelog.sh
tools/changelog.sh
+15
-15
No files found.
tools/changelog.sh
View file @
4b3a5c54
...
@@ -201,9 +201,9 @@ function display-release {
...
@@ -201,9 +201,9 @@ function display-release {
#* Uses $hash from outer scope
#* Uses $hash from outer scope
local hash
=
"
${
1
:-
$hash
}
"
local hash
=
"
${
1
:-
$hash
}
"
case
"
$output
"
in
case
"
$output
"
in
raw
)
printf
"
$hash
"
;;
raw
)
printf
'%s'
"
$hash
"
;;
text
)
printf
"
\e
[33m
$hash
\e
[0m
"
;;
# red
text
)
printf
'\e[33m%s\e[0m'
"
$hash
"
;;
# red
md
)
printf
"[
\`
$hash
\`
](https://github.com/ohmyzsh/ohmyzsh/commit/
$hash
)
"
;;
md
)
printf
'[`%s`](https://github.com/ohmyzsh/ohmyzsh/commit/%s)'
"
$hash
"
;;
esac
esac
}
}
...
@@ -215,16 +215,16 @@ function display-release {
...
@@ -215,16 +215,16 @@ function display-release {
case
"
$output
"
in
case
"
$output
"
in
raw
)
raw
)
case
"
$level
"
in
case
"
$level
"
in
1
)
printf
"
$header
\n
$(
printf
'%.0s='
{
1..
${#
header
}
}
)
\n\n
"
;;
1
)
printf
'%s\n%s\n\n'
"
$header
"
"
$(
printf
'%.0s='
{
1..
${#
header
}
}
)
"
;;
2
)
printf
"
$header
\n
$(
printf
'%.0s-'
{
1..
${#
header
}
}
)
\n\n
"
;;
2
)
printf
'%s\n%s\n\n'
"
$header
"
"
$(
printf
'%.0s-'
{
1..
${#
header
}
}
)
"
;;
*
)
printf
"
$header
:
\n\n
"
;;
*
)
printf
'%s:\n\n'
"
$header
"
;;
esac
;;
esac
;;
text
)
text
)
case
"
$level
"
in
case
"
$level
"
in
1|2
)
printf
"
\e
[1;4m
$header
\e
[0m
\n\n
"
;;
# bold, underlined
1|2
)
printf
'\e[1;4m%s\e[0m\n\n'
"
$header
"
;;
# bold, underlined
*
)
printf
"
\e
[1m
$header
:
\e
[0m
\n\n
"
;;
# bold
*
)
printf
'\e[1m%s:\e[0m\n\n'
"
$header
"
;;
# bold
esac
;;
esac
;;
md
)
printf
"
$(
printf
'%.0s#'
{
1..
${
level
}
}
)
$header
\n\n
"
;;
md
)
printf
'%s %s\n\n'
"
$(
printf
'%.0s#'
{
1..
${
level
}
}
)
"
"
$header
"
;;
esac
esac
}
}
...
@@ -250,8 +250,8 @@ function display-release {
...
@@ -250,8 +250,8 @@ function display-release {
# Print [scope]
# Print [scope]
case
"
$output
"
in
case
"
$output
"
in
raw|md
)
printf
"[
$scope
]
${
padding
}
"
;;
raw|md
)
printf
'[%s]%s '
"
$scope
"
"
$padding
"
;;
text
)
printf
"[
\e
[38;5;9m
$scope
\e
[0m]
${
padding
}
"
;;
# red 9
text
)
printf
'[\e[38;5;9m%s\e[0m]%s '
"
$scope
"
"
$padding
"
;;
# red 9
esac
esac
}
}
...
@@ -264,7 +264,7 @@ function display-release {
...
@@ -264,7 +264,7 @@ function display-release {
subject
=
"
${
(U)subject
:0:1
}${
subject
:1
}
"
subject
=
"
${
(U)subject
:0:1
}${
subject
:1
}
"
case
"
$output
"
in
case
"
$output
"
in
raw
)
printf
"
$subject
"
;;
raw
)
printf
'%s'
"
$subject
"
;;
# In text mode, highlight (#<issue>) and dim text between `backticks`
# In text mode, highlight (#<issue>) and dim text between `backticks`
text
)
sed
-E
$'s|#([0-9]+)|
\e
[32m#
\\
1
\e
[0m|g;s|`([^`]+)`|`
\e
[2m
\\
1
\e
[0m`|g'
<<<
"
$subject
"
;;
text
)
sed
-E
$'s|#([0-9]+)|
\e
[32m#
\\
1
\e
[0m|g;s|`([^`]+)`|`
\e
[2m
\\
1
\e
[0m`|g'
<<<
"
$subject
"
;;
# In markdown mode, link to (#<issue>) issues
# In markdown mode, link to (#<issue>) issues
...
@@ -277,8 +277,8 @@ function display-release {
...
@@ -277,8 +277,8 @@ function display-release {
local type
=
"
${
1
:-${
TYPES
[
$type
]
:-${
(C)type
}}}
"
local type
=
"
${
1
:-${
TYPES
[
$type
]
:-${
(C)type
}}}
"
[[
-z
"
$type
"
]]
&&
return
0
[[
-z
"
$type
"
]]
&&
return
0
case
"
$output
"
in
case
"
$output
"
in
raw|md
)
printf
"
$type
:
"
;;
raw|md
)
printf
'%s: '
"
$type
"
;;
text
)
printf
"
\e
[4m
$type
\e
[24m:
"
;;
# underlined
text
)
printf
'\e[4m%s\e[24m: '
"
$type
"
;;
# underlined
esac
esac
}
}
...
@@ -292,7 +292,7 @@ function display-release {
...
@@ -292,7 +292,7 @@ function display-release {
((
$#breaking
!=
0
))
||
return
0
((
$#breaking
!=
0
))
||
return
0
case
"
$output
"
in
case
"
$output
"
in
text
)
fmt
:header
"
\e
[31m
BREAKING CHANGES"
3
;;
text
)
printf
'\e[31m'
;
fmt
:header
"
BREAKING CHANGES"
3
;;
raw
)
fmt
:header
"BREAKING CHANGES"
3
;;
raw
)
fmt
:header
"BREAKING CHANGES"
3
;;
md
)
fmt
:header
"BREAKING CHANGES ⚠"
3
;;
md
)
fmt
:header
"BREAKING CHANGES ⚠"
3
;;
esac
esac
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment