Push branch; update ticket urls

This commit is contained in:
Adolfo Perez Alvarez 2024-02-13 16:27:01 +01:00
parent 517a2bd6ca
commit 2340af8c9d
1 changed files with 3 additions and 1 deletions

4
g
View File

@ -1,13 +1,15 @@
#!/usr/bin/env ksh
if [[ $1 = "pc" || ( $1 = "pr" && $2 = "create" ) ]]
then
remote=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null | cut -d/ -f1)
git push --set-upstream ${remote:-origin} $(git branch --show-current)
tmp=$(mktemp /tmp/g.XXXXXXXXXXX.md)
if [[ -f ~/.g.template ]]
then
lps=$(git show --pretty='format:%s' --no-patch | cut -d' ' -f1)
if [[ ! -z $lps ]]
then
url="https://issues.liferay.com/browse/"$lps
url="https://liferay.atlassian.net/browse/"$lps
sed -e "s/{lps}/$lps/g" -e "s,{url},$url," <~/.g.template >$tmp
fi
fi