g - thin wrapper over gh
This commit is contained in:
parent
ae82639757
commit
151c120115
19
g
Executable file
19
g
Executable file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env ksh
|
||||
if [[ $1 = "pc" || ( $1 = "pr" && $2 = "create" ) ]]
|
||||
then
|
||||
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
|
||||
sed -e "s/{lps}/$lps/g" -e "s,{url},$url," <~/.g.template >$tmp
|
||||
fi
|
||||
fi
|
||||
${GH_EDITOR:-${VISUAL:-${EDITOR:-ed}}} ${tmp} >/dev/null
|
||||
gh $@ --title "$(head -1 $tmp)" --body "$(tail -n +3 $tmp)"
|
||||
mv -f $tmp /tmp/g.lastpr
|
||||
else
|
||||
gh $@
|
||||
fi
|
Loading…
Reference in New Issue
Block a user