2021-12-11 21:09:02 +00:00
|
|
|
edit:add-var commitkcp~ {|@argv|
|
2021-08-24 18:45:25 +00:00
|
|
|
use str
|
2021-12-27 17:54:26 +00:00
|
|
|
|
2021-08-27 19:45:39 +00:00
|
|
|
var m = [
|
2021-08-24 18:45:25 +00:00
|
|
|
&name=
|
|
|
|
&ver=
|
|
|
|
]
|
2021-12-11 21:09:02 +00:00
|
|
|
keys $m | each {|k|
|
2021-12-27 17:54:26 +00:00
|
|
|
var p = (printf 'pkg%s=' $k)
|
2021-10-13 18:43:40 +00:00
|
|
|
set m[$k] = (str:trim-prefix (cat PKGBUILD | grep $p | take 1) $p)
|
2021-08-24 18:45:25 +00:00
|
|
|
}
|
|
|
|
|
2021-12-27 17:54:26 +00:00
|
|
|
var msg = (printf '%s %s' $m[name] $m[ver])
|
2021-08-24 18:45:25 +00:00
|
|
|
if (> (count $argv) 0) {
|
2021-12-27 17:54:26 +00:00
|
|
|
set msg = (printf '%s - %s' $msg (str:join ' ' $argv))
|
2021-08-24 18:45:25 +00:00
|
|
|
}
|
|
|
|
|
2021-12-27 17:54:26 +00:00
|
|
|
printf "git commit -am '%s'; git push" $msg
|
2021-08-24 18:45:25 +00:00
|
|
|
git commit -am $msg; git push
|
|
|
|
}
|