elvish_config/aliases/commitkcp.elv

21 lines
435 B
Plaintext

edit:add-var commitkcp~ {|@argv|
use str
var m = [
&name=
&ver=
]
keys $m | each {|k|
var p = (printf 'pkg%s=' $k)
set m[$k] = (str:trim-prefix (cat PKGBUILD | grep $p | take 1) $p)
}
var msg = (printf '%s %s' $m[name] $m[ver])
if (> (count $argv) 0) {
set msg = (printf '%s - %s' $msg (str:join ' ' $argv))
}
printf "git commit -am '%s'; git push\n" $msg
git commit -am $msg; git push
}